Explorar el Código

Fix memory leak on error path in http_header_set_format

Alex Henrie hace 4 años
padre
commit
7e7d4e291d
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      components/esp_http_client/lib/http_header.c

+ 1 - 1
components/esp_http_client/lib/http_header.c

@@ -162,8 +162,8 @@ int http_header_set_format(http_header_handle_t header, const char *key, const c
     char *buf = NULL;
     va_start(argptr, format);
     len = vasprintf(&buf, format, argptr);
-    HTTP_MEM_CHECK(TAG, buf, return 0);
     va_end(argptr);
+    HTTP_MEM_CHECK(TAG, buf, return 0);
     if (buf == NULL) {
         return 0;
     }