]> granicus.if.org Git - pgbouncer/commitdiff
Missing varargs cleanup.
authorEuler Taveira <euler@timbira.com>
Thu, 30 Apr 2015 15:16:25 +0000 (12:16 -0300)
committerEuler Taveira <euler@timbira.com>
Thu, 30 Apr 2015 15:30:34 +0000 (12:30 -0300)
Spotted by Coverity.

src/proto.c

index ad1e0395946ac779e4110392593352e3d536ff9c..d35a441b69f353c74876f848b5aee11fbe9fc131 100644 (file)
@@ -383,13 +383,17 @@ int scan_text_result(struct MBuf *pkt, const char *tupdesc, ...)
        va_start(ap, tupdesc);
        for (i = 0; i < asked; i++) {
                if (i < ncol) {
-                       if (!mbuf_get_uint32be(pkt, &len))
+                       if (!mbuf_get_uint32be(pkt, &len)) {
+                               va_end(ap);
                                return -1;
+                       }
                        if ((int32_t)len < 0) {
                                val = NULL;
                        } else {
-                               if (!mbuf_get_chars(pkt, len, &val))
+                               if (!mbuf_get_chars(pkt, len, &val)) {
+                                       va_end(ap);
                                        return -1;
+                               }
                        }
 
                        /* hack to zero-terminate the result */