summaryrefslogtreecommitdiffstats
path: root/src/jplist.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2022-01-31 23:53:50 +0100
committerGravatar Nikias Bassen2022-01-31 23:53:50 +0100
commitdb4635a081b03eb9a2ea310bfb2f994fd9d4ee94 (patch)
tree272814b02879f2fd18df540b461ff1f3034c2df5 /src/jplist.c
parent6fcecd0226ee25e69ce049c4eba10933a0a2e944 (diff)
downloadlibplist-db4635a081b03eb9a2ea310bfb2f994fd9d4ee94.tar.gz
libplist-db4635a081b03eb9a2ea310bfb2f994fd9d4ee94.tar.bz2
jplist: Fix memory leak that occurs when JSON parsing fails
Credit to OSS-Fuzz
Diffstat (limited to 'src/jplist.c')
-rw-r--r--src/jplist.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/jplist.c b/src/jplist.c
index 827b367..65eb528 100644
--- a/src/jplist.c
+++ b/src/jplist.c
@@ -663,6 +663,7 @@ static plist_t parse_object(const char* js, jsmntok_info_t* ti, int* index)
if (val) {
plist_dict_set_item(obj, key, val);
} else {
+ free(key);
plist_free(obj);
return NULL;
}