Skip to content
Snippets Groups Projects
Commit 9d134cbd authored by Sergei Rashitov's avatar Sergei Rashitov
Browse files

[*] Fix memory leak in gdb history API

parent 51a1d106
No related branches found
No related tags found
1 merge request!114Fix memory leak in gdb history API
Pipeline #3820 passed with stage
in 13 seconds
...@@ -1130,11 +1130,13 @@ bool dap_db_history_truncate(void) ...@@ -1130,11 +1130,13 @@ bool dap_db_history_truncate(void)
*/ */
uint64_t dap_db_log_get_group_history_last_id(const char *a_history_group_name) uint64_t dap_db_log_get_group_history_last_id(const char *a_history_group_name)
{ {
uint64_t result = 0;
dap_store_obj_t *l_last_obj = dap_chain_global_db_get_last(a_history_group_name); dap_store_obj_t *l_last_obj = dap_chain_global_db_get_last(a_history_group_name);
if(l_last_obj) { if(l_last_obj) {
return l_last_obj->id; result = l_last_obj->id;
}else dap_store_obj_free(l_last_obj, 1);
return 0; }
return result;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment