소스 검색

Merge pull request #415 from Alanscut/fix_issue_414

fix memory leak mentioned in issue 414
Alanscut 5 년 전
부모
커밋
8badd19b64
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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> */