Skip to content

Commit 4382ad8

Browse files
committed
Removed null pointer check at start of string parser function to avoid illegal memory free calls.
1 parent df3d3f7 commit 4382ad8

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/cJSON.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ cJSON_Result_t cJSON_delGenObj(cJSON_Generic_t GObj)
8989

9090
cJSON_Result_t cJSON_parseStr(cJSON_Generic_t *GObjPtr, const char *str)
9191
{
92-
// Check if GObjPtr is allocated. If so delete old data structure
93-
if (GObjPtr->dataContainer != NULL) cJSON_delGenObj(*GObjPtr);
94-
9592
// Create object stack
9693
cJSON_GenericStack_t ObjectStack = GS_Create(CJSON_MAX_DEPTH);
9794

0 commit comments

Comments
 (0)