From: Euler Taveira Date: Thu, 30 Apr 2015 15:16:25 +0000 (-0300) Subject: Missing varargs cleanup. X-Git-Tag: pgbouncer_1_6~7^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45db5320fb5b354c8c44b9e05d043095eef84ec2;p=pgbouncer Missing varargs cleanup. Spotted by Coverity. --- diff --git a/src/proto.c b/src/proto.c index ad1e039..d35a441 100644 --- a/src/proto.c +++ b/src/proto.c @@ -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 */