diff --git a/dap_chain_global_db.c b/dap_chain_global_db.c index 35c4648b613c6ec361fbd3411f2c50fa394dc5dc..cf9d2efac6ec033e06da5f23d3db98acf4643fc2 100755 --- a/dap_chain_global_db.c +++ b/dap_chain_global_db.c @@ -19,7 +19,7 @@ static pthread_mutex_t ldb_mutex = PTHREAD_MUTEX_INITIALIZER; */ static bool is_local_group(const char *a_group) { - if(!strcmp(a_group, GROUP_ALIAS) || !strcmp(a_group, GROUP_REMOTE_NODE)) + if( strncmp(a_group, "local.",6)==0 ) return true; return false; } diff --git a/dap_chain_global_db_hist.c b/dap_chain_global_db_hist.c index 6512a2e954322973ef69c97f86c3fcd603d0fb3b..cee5eee10b3e06838bff4683bdd26058fcb6f257 100755 --- a/dap_chain_global_db_hist.c +++ b/dap_chain_global_db_hist.c @@ -62,6 +62,11 @@ uint8_t* dap_db_log_pack(dap_global_db_obj_t *a_obj, int *a_data_size_out) while(l_keys[i]) { dap_store_obj_t *l_obj = (dap_store_obj_t*) dap_chain_global_db_obj_get(l_keys[i], l_rec.group); + if (l_obj == NULL){ + dab_db_free_pdap_store_obj_t(l_store_obj, l_count); + dap_strfreev(l_keys); + return NULL; + } memcpy(l_store_obj + i, l_obj, sizeof(dap_store_obj_t)); DAP_DELETE(l_obj); i++;