Browse Source

unit_test.c: close va_list before return

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf 10 years ago
parent
commit
5bf5f19452
1 changed files with 4 additions and 1 deletions
  1. 4 1
      test/unit_test.c

+ 4 - 1
test/unit_test.c

@@ -579,8 +579,11 @@ static void test_mg_websocket_client_connect(int use_ssl) {
 
 static int alloc_printf(char **buf, size_t size, char *fmt, ...) {
     va_list ap;
+    int ret = 0;
     va_start(ap, fmt);
-    return alloc_vprintf(buf, size, fmt, ap);
+    ret = alloc_vprintf(buf, size, fmt, ap);
+    va_end(ap);
+    return ret:
 }
 
 static void test_mg_upload(void) {