fix memory leak in test case

This commit is contained in:
root
2024-10-25 06:27:34 +00:00
parent b663077045
commit 12241e6580
2 changed files with 6 additions and 2 deletions

View File

@@ -7830,6 +7830,8 @@ void foreign_key_test_entry_cb(const char *table_name, const char *table_line, e
strcpy(file2_to_del, file2_localname);
g_test_foreign_del_OK = 1;
}
cJSON_Delete(json);
}
TEST_F(MaatCmd, SetFile) {
@@ -8012,6 +8014,8 @@ void plugin_ex_new_cb(const char *table_name, const char *key,
EXPECT_TRUE(tmp_obj != NULL);
snprintf(u->name, sizeof(u->name), "%s", tmp_obj->valuestring);
cJSON_Delete(json);
*ad = u;
(*counter)++;
}