Explorar o código

cJSON_PrintBuffered: Fix potential memory leak

Max Bruckner %!s(int64=8) %!d(string=hai) anos
pai
achega
2a3a313f83
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      cJSON.c

+ 1 - 0
cJSON.c

@@ -1111,6 +1111,7 @@ CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON
 
     if (!print_value(item, &p))
     {
+        global_hooks.deallocate(p.buffer);
         return NULL;
     }