]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
remove resource leak
authorMark Andrews <marka@isc.org>
Tue, 6 May 2014 10:51:33 +0000 (20:51 +1000)
committerMark Andrews <marka@isc.org>
Tue, 6 May 2014 10:52:44 +0000 (20:52 +1000)
(cherry picked from commit 215f02a137818f7c67edb0ba655640bcd3f187c5)

bin/tests/dst/t_dst.c

index 5416c77e683cc495eef144e3bc36a60cb8a66309..896f77b45e5d22f4cc8a63aef306d287255d1df1 100644 (file)
@@ -678,13 +678,13 @@ sig_fromfile(char *path, isc_buffer_t *iscbuf) {
                        --len;
                        continue;
                } else if (len < 2U)
-                      return (1);
+                      goto err;
                if (('0' <= *p) && (*p <= '9'))
                        val = *p - '0';
                else if (('A' <= *p) && (*p <= 'F'))
                        val = *p - 'A' + 10;
                else
-                       return (1);
+                       goto err;
                ++p;
                val <<= 4;
                --len;
@@ -693,13 +693,17 @@ sig_fromfile(char *path, isc_buffer_t *iscbuf) {
                else if (('A' <= *p) && (*p <= 'F'))
                        val |= (*p - 'A' + 10);
                else
-                       return (1);
+                       goto err;
                ++p;
                --len;
                isc_buffer_putuint8(iscbuf, val);
        }
        (void) free(buf);
        return(0);
+
+ err:
+       (void) free(buf);
+       return (1);
 }
 
 static void