forked from Telodendria/Telodendria
Fix potential memory leak if duplicate keys exist in a JSON object.
This commit is contained in:
parent
01a6d71101
commit
d0c81a8136
1 changed files with 2 additions and 1 deletions
|
@ -947,7 +947,8 @@ JsonDecodeObject(JsonParserState * state)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
HashMapSet(obj, key, value);
|
/* If there's an existing value at this key, discard it. */
|
||||||
|
JsonValueFree(HashMapSet(obj, key, value));
|
||||||
|
|
||||||
JsonTokenSeek(state);
|
JsonTokenSeek(state);
|
||||||
if (JsonExpect(state, TOKEN_OBJECT_CLOSE))
|
if (JsonExpect(state, TOKEN_OBJECT_CLOSE))
|
||||||
|
|
Loading…
Reference in a new issue