ndr: Free memory in torture test to satisfy sanitizer
authorSwen Schillig <swen@linux.ibm.com>
Mon, 29 Jul 2019 08:23:14 +0000 (10:23 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 8 Aug 2019 10:08:32 +0000 (10:08 +0000)
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
source4/torture/ndr/cabinet.c
source4/torture/ndr/clusapi.c

index 8cdf4cb..5b93108 100644 (file)
@@ -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;
 }
 
index cf2ac67..db6a27c 100644 (file)
@@ -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;
 }