From 5b1651ecd6c62f018e759f21bca33edf4f54b74c Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Wed, 13 Nov 2024 19:20:51 +0100 Subject: [PATCH] Fix memory leak in parson's parse_object_value() --- src/common/parson/parson.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/parson/parson.c b/src/common/parson/parson.c index 20cb43f4f..d71a7baa4 100644 --- a/src/common/parson/parson.c +++ b/src/common/parson/parson.c @@ -742,6 +742,9 @@ static JSON_Value * parse_object_value(const char **string, size_t nesting) { new_key = get_quoted_string(string, &key_len); /* We do not support key names with embedded \0 chars */ if (new_key == NULL || key_len != strlen(new_key)) { + if (new_key) { + parson_free(new_key); + } json_value_free(output_value); return NULL; }