Explorar o código

fix memory leak mentioned in issue 414

Alanscut %!s(int64=5) %!d(string=hai) anos
pai
achega
500a9db81b
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      cJSON_Utils.c

+ 1 - 0
cJSON_Utils.c

@@ -216,6 +216,7 @@ CJSON_PUBLIC(char *) cJSONUtils_FindPointerFromObjectTo(const cJSON * const obje
                 if (child_index > ULONG_MAX)
                 {
                     cJSON_free(target_pointer);
+                    cJSON_free(full_pointer);
                     return NULL;
                 }
                 sprintf((char*)full_pointer, "/%lu%s", (unsigned long)child_index, target_pointer); /* /<array_index><path> */