From: Andrew Bartlett Date: Mon, 23 Nov 2020 07:27:51 +0000 (+1300) Subject: torture: Do not call destroy_dlz() on uninitialised memory X-Git-Tag: samba-4.14.0rc1~564 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f226bea5de892e3dbda3c0737edf054399ec0104;p=thirdparty%2Fsamba.git torture: Do not call destroy_dlz() on uninitialised memory BUG: https://bugzilla.samba.org/show_bug.cgi?id=14579 Reviewed-by: Andreas Schneider Signed-off-by: Andrew Bartlett --- diff --git a/source4/torture/dns/dlz_bind9.c b/source4/torture/dns/dlz_bind9.c index e5aec26e20a..cd700fe986d 100644 --- a/source4/torture/dns/dlz_bind9.c +++ b/source4/torture/dns/dlz_bind9.c @@ -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]);