]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
torture: Do not call destroy_dlz() on uninitialised memory
authorAndrew Bartlett <abartlet@samba.org>
Mon, 23 Nov 2020 07:27:51 +0000 (20:27 +1300)
committerStefan Metzmacher <metze@samba.org>
Thu, 26 Nov 2020 06:52:41 +0000 (06:52 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14579

Reviewed-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source4/torture/dns/dlz_bind9.c

index e5aec26e20a5b768c180288777d2e0decda32d0c..cd700fe986d820b100b2fbb52f1c5e6dab1cb0ea 100644 (file)
@@ -195,8 +195,13 @@ static bool test_dlz_bind9_destroy_oldest_first(struct torture_context *tctx)
 {
        void *dbdata[NUM_DLZS_TO_CONFIGURE];
        int i;
-
-       configure_multiple_dlzs(tctx, dbdata, NUM_DLZS_TO_CONFIGURE);
+       bool ret = configure_multiple_dlzs(tctx,
+                                          dbdata,
+                                          NUM_DLZS_TO_CONFIGURE);
+       if (ret == false) {
+               /* failure: has already been printed */
+               return false;
+       }
 
        /* Reload faults are reported to happen on the first destroy */
        dlz_destroy(dbdata[0]);
@@ -212,8 +217,13 @@ static bool test_dlz_bind9_destroy_newest_first(struct torture_context *tctx)
 {
        void *dbdata[NUM_DLZS_TO_CONFIGURE];
        int i;
-
-       configure_multiple_dlzs(tctx, dbdata, NUM_DLZS_TO_CONFIGURE);
+       bool ret = configure_multiple_dlzs(tctx,
+                                          dbdata,
+                                          NUM_DLZS_TO_CONFIGURE);
+       if (ret == false) {
+               /* failure: has already been printed */
+               return false;
+       }
 
        for(i = NUM_DLZS_TO_CONFIGURE - 1; i >= 0; i--) {
                dlz_destroy(dbdata[i]);