From: Mark Andrews Date: Thu, 8 Mar 2012 03:28:26 +0000 (+1100) Subject: 3294. [bug] isccc/cc.c:table_fromwire failed to free alist on X-Git-Tag: v9.10.0a1~1307 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=962bf88eec1ea34a451769ba82c9389db7f0bef0;p=thirdparty%2Fbind9.git 3294. [bug] isccc/cc.c:table_fromwire failed to free alist on error. [RT #28265] --- diff --git a/CHANGES b/CHANGES index 5f9d9ee2ba0..2752138eeb4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3294. [bug] isccc/cc.c:table_fromwire failed to free alist on + error. [RT #28265] + 3293. [func] nsupdate: list supported type. [RT #28261] 3292. [func] Log messages in the axfr stream at debug 10. diff --git a/bin/named/controlconf.c b/bin/named/controlconf.c index 964561a69b3..7fbc948630f 100644 --- a/bin/named/controlconf.c +++ b/bin/named/controlconf.c @@ -373,17 +373,8 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) { if (result == ISC_R_SUCCESS) break; isc_mem_put(listener->mctx, secret.rstart, REGION_SIZE(secret)); - if (result == ISCCC_R_BADAUTH) { - /* - * For some reason, request is non-NULL when - * isccc_cc_fromwire returns ISCCC_R_BADAUTH. - */ - if (request != NULL) - isccc_sexpr_free(&request); - } else { - log_invalid(&conn->ccmsg, result); - goto cleanup; - } + log_invalid(&conn->ccmsg, result); + goto cleanup; } if (key == NULL) { diff --git a/lib/isccc/cc.c b/lib/isccc/cc.c index cfa1db662e3..799e34384d4 100644 --- a/lib/isccc/cc.c +++ b/lib/isccc/cc.c @@ -403,16 +403,17 @@ table_fromwire(isccc_region_t *source, isccc_region_t *secret, if (secret != NULL) { if (checksum_rstart != NULL) - return (verify(alist, checksum_rstart, - (source->rend - checksum_rstart), - secret)); - return (ISCCC_R_BADAUTH); - } - - return (ISC_R_SUCCESS); + result = verify(alist, checksum_rstart, + (source->rend - checksum_rstart), + secret); + else + result = ISCCC_R_BADAUTH; + } else + result = ISC_R_SUCCESS; bad: - isccc_sexpr_free(&alist); + if (result != ISC_R_SUCCESS) + isccc_sexpr_free(&alist); return (result); }