From: Swen Schillig Date: Mon, 29 Jul 2019 08:23:14 +0000 (+0200) Subject: ndr: Free memory in torture test to satisfy sanitizer X-Git-Tag: tdb-1.4.2~239 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb8cc5956f7bac9afedcba2744d691b2d8485b62;p=thirdparty%2Fsamba.git ndr: Free memory in torture test to satisfy sanitizer Signed-off-by: Swen Schillig Reviewed-by: Andrew Bartlett Reviewed-by: Matthias Dieter Wallnöfer --- diff --git a/source4/torture/ndr/cabinet.c b/source4/torture/ndr/cabinet.c index 8cdf4cb4930..5b931083906 100644 --- a/source4/torture/ndr/cabinet.c +++ b/source4/torture/ndr/cabinet.c @@ -4173,6 +4173,8 @@ static bool cab_file_plain_check(struct torture_context *tctx, torture_assert_data_blob_equal(tctx, r->cfdata[0].ab, blob, "ab"); + data_blob_free(&blob); + return true; } @@ -4236,6 +4238,8 @@ static bool cab_file_MSZIP_check(struct torture_context *tctx, torture_assert_data_blob_equal(tctx, r->cfdata[0].ab, blob, "ab"); + data_blob_free(&blob); + return true; } @@ -4305,6 +4309,8 @@ static bool cab_file_LZX_check(struct torture_context *tctx, /* once we have LZX compression support we can enable this test */ torture_assert_data_blob_equal(tctx, r->cfdata[0].ab, blob, "ab"); #endif + data_blob_free(&blob); + return true; } diff --git a/source4/torture/ndr/clusapi.c b/source4/torture/ndr/clusapi.c index cf2ac67873e..db6a27c63ca 100644 --- a/source4/torture/ndr/clusapi.c +++ b/source4/torture/ndr/clusapi.c @@ -141,6 +141,9 @@ static bool clusapi_PROPERTY_LIST_check(struct torture_context *tctx, torture_assert_int_equal(tctx, r->propertyValues[5].PropertyValues.Padding.length, 0, "PropertyValues.Padding.length"); torture_assert_int_equal(tctx, r->propertyValues[5].end_mark, CLUSPROP_SYNTAX_ENDMARK, "end_mark"); + data_blob_free(&blob_dword_null); + data_blob_free(&blob_dword_one); + return true; } @@ -362,6 +365,10 @@ static bool clusapi_PROPERTY_LIST_check2(struct torture_context *tctx, torture_assert_int_equal(tctx, r->propertyValues[11].PropertyValues.Padding.length, 0, "PropertyValues.Padding.length"); torture_assert_int_equal(tctx, r->propertyValues[11].end_mark, CLUSPROP_SYNTAX_ENDMARK, "end_mark"); + data_blob_free(&blob_dword_null); + data_blob_free(&blob_dword_one); + data_blob_free(&blob_dword); + return true; }