summaryrefslogtreecommitdiffstats
path: root/src/jplist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/jplist.c')
-rw-r--r--src/jplist.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/jplist.c b/src/jplist.c
index fe0b5cb..193d231 100644
--- a/src/jplist.c
+++ b/src/jplist.c
@@ -581,6 +581,9 @@ static plist_t parse_primitive(const char* js, jsmntok_info_t* ti, int* index)
}
data->type = PLIST_NULL;
val = plist_new_node(data);
+ if (!val) {
+ plist_free_data(data);
+ }
} else if (isdigit(str_val[0]) || (str_val[0] == '-' && str_val+1 < str_end && isdigit(str_val[1]))) {
char* endp = (char*)str_val;
int is_neg = (str_val[0] == '-');