]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
address memory leak in change #3662, force format matching, attempt to address coveri...
authorMark Andrews <marka@isc.org>
Fri, 25 Oct 2013 23:04:36 +0000 (10:04 +1100)
committerMark Andrews <marka@isc.org>
Fri, 25 Oct 2013 23:11:12 +0000 (10:11 +1100)
(cherry picked from commit 938aea1dc406d525d0c2bbdd4e71f52a942f97c6)
(cherry picked from commit dc44093efcde33d24c8805e73a1d42d7c1873b87)

bin/dig/dighost.c
lib/dns/rdata/generic/isdn_20.c

index 18bc2a6fa0bc6604a765fa088cb3330ff2a00c53..0d65306253d004286d2a60850f8d4d943b704755 100644 (file)
@@ -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);
index 90142c568ec967dec06ec47ae89908730ce39f39..b758835e15691f8777abb0bb73e06bc82678b17d 100644 (file)
@@ -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));