From: Mark Andrews Date: Fri, 25 Oct 2013 23:04:36 +0000 (+1100) Subject: address memory leak in change #3662, force format matching, attempt to address coveri... X-Git-Tag: v9.6-ESV-R11b1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be4c5c3810c350e011ea86975a6f333c811d2647;p=thirdparty%2Fbind9.git address memory leak in change #3662, force format matching, attempt to address coverity false positives (cherry picked from commit 938aea1dc406d525d0c2bbdd4e71f52a942f97c6) (cherry picked from commit dc44093efcde33d24c8805e73a1d42d7c1873b87) --- diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 18bc2a6fa0b..0d65306253d 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -519,8 +519,8 @@ debug(const char *format, ...) { if (debugtiming) { struct timeval tv; (void)gettimeofday(&tv, NULL); - fprintf(stderr, "%ld.%06d: ", (long)tv.tv_sec, - tv.tv_usec); + fprintf(stderr, "%ld.%06ld: ", (long)tv.tv_sec, + (long)tv.tv_usec); } va_start(args, format); vfprintf(stderr, format, args); @@ -2647,11 +2647,13 @@ launch_next_query(dig_query_t *query, isc_boolean_t include_question) { isc_buffer_putuint16(&query->slbuf, (isc_uint16_t) query->sendbuf.used); ISC_LIST_INIT(query->sendlist); ISC_LINK_INIT(&query->slbuf, link); - buffer = clone_buffer(&query->slbuf); - ISC_LIST_ENQUEUE(query->sendlist, buffer, link); - if (include_question) { - buffer = clone_buffer(&query->sendbuf); - ISC_LIST_ENQUEUE(query->sendlist, buffer, link); + if (!query->first_soa_rcvd) { + buffer = clone_buffer(&query->slbuf); + ISC_LIST_ENQUEUE(query->sendlist, buffer, link); + if (include_question) { + buffer = clone_buffer(&query->sendbuf); + ISC_LIST_ENQUEUE(query->sendlist, buffer, link); + } } ISC_LINK_INIT(&query->lengthbuf, link); diff --git a/lib/dns/rdata/generic/isdn_20.c b/lib/dns/rdata/generic/isdn_20.c index 90142c568ec..b758835e156 100644 --- a/lib/dns/rdata/generic/isdn_20.c +++ b/lib/dns/rdata/generic/isdn_20.c @@ -127,7 +127,7 @@ fromstruct_isdn(ARGS_FROMSTRUCT) { RETERR(uint8_tobuffer(isdn->isdn_len, target)); RETERR(mem_tobuffer(target, isdn->isdn, isdn->isdn_len)); - if (isdn->subaddress == NULL && isdn->subaddress_len == 0) + if (isdn->subaddress == NULL) return (ISC_R_SUCCESS); RETERR(uint8_tobuffer(isdn->subaddress_len, target)); return (mem_tobuffer(target, isdn->subaddress, isdn->subaddress_len));