void-packages/srcpkgs/cJSON/patches/0001-fix-memory-leak.patch

25 lines
816 B
Diff
Raw Normal View History

2019-12-07 01:46:05 +01:00
From 7b65bd348da0411f2d6db12f21f7562e7286416c Mon Sep 17 00:00:00 2001
From: Alanscut <wp_scut@163.com>
Date: Thu, 5 Dec 2019 11:05:07 +0800
Subject: [PATCH] fix memory leak mentioned in issue 414
---
cJSON_Utils.c | 1 +
1 file changed, 1 insertion(+)
diff --git cJSON_Utils.c cJSON_Utils.c
index 7df4db2..b890d17 100644
--- cJSON_Utils.c
+++ cJSON_Utils.c
@@ -216,6 +216,7 @@ CJSON_PUBLIC(char *) cJSONUtils_FindPointerFromObjectTo(const cJSON * const obje
if (child_index > ULONG_MAX)
{
cJSON_free(target_pointer);
+ cJSON_free(full_pointer);
return NULL;
}
sprintf((char*)full_pointer, "/%lu%s", (unsigned long)child_index, target_pointer); /* /<array_index><path> */
--
2.24.0