]> git.feebdaed.xyz Git - 0xmirror/cJSON.git/commitdiff
Free mem in cjson_set_valuestring_should_return_null_if_strings_overlap
authorNicolas Badoux <n.badoux@hotmail.com>
Mon, 26 Aug 2024 07:48:59 +0000 (09:48 +0200)
committerAlan Wang <wp_scut@163.com>
Fri, 30 Aug 2024 03:29:28 +0000 (11:29 +0800)
tests/misc_tests.c

index e1187f836141de6d9571de04b7991c1312e37bbe..606b4603449cfcfad3539ddb23b30944f03c949b 100644 (file)
@@ -486,6 +486,7 @@ static void cjson_set_valuestring_should_return_null_if_strings_overlap(void)
     /* If it overlaps, the string will be messed up.*/
     TEST_ASSERT_TRUE(strcmp(str, "bcde") == 0);
     TEST_ASSERT_NULL(str2);
+    cJSON_Delete(obj);
 }
 
 static void *CJSON_CDECL failing_realloc(void *pointer, size_t size)