Commit 89a79af8 authored by Kishen Maloor's avatar Kishen Maloor

Merge branch 'origin/master' into fargo

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parents 8bd6c0c0 7c50703a
Pipeline #724 passed with stage
in 12 minutes and 12 seconds
--- ---
image: gcc image: gcc:9.3.0
Linux_Secured_Test: Linux_Secured_Test:
variables: variables:
......
...@@ -375,8 +375,10 @@ static oc_event_callback_retval_t ...@@ -375,8 +375,10 @@ static oc_event_callback_retval_t
free_discovery_cb(void *data) free_discovery_cb(void *data)
{ {
oc_discovery_cb_t *c = (oc_discovery_cb_t *)data; oc_discovery_cb_t *c = (oc_discovery_cb_t *)data;
oc_list_remove(oc_discovery_cbs, c); if (is_item_in_list(oc_discovery_cbs, c)) {
oc_memb_free(&oc_discovery_s, c); oc_list_remove(oc_discovery_cbs, c);
oc_memb_free(&oc_discovery_s, c);
}
return OC_EVENT_DONE; return OC_EVENT_DONE;
} }
...@@ -2699,10 +2701,10 @@ oc_obt_shutdown(void) ...@@ -2699,10 +2701,10 @@ oc_obt_shutdown(void)
oc_memb_free(&oc_devices_s, device); oc_memb_free(&oc_devices_s, device);
device = (oc_device_t *)oc_list_pop(oc_devices); device = (oc_device_t *)oc_list_pop(oc_devices);
} }
oc_discovery_cb_t *cb = (oc_discovery_cb_t *)oc_list_pop(oc_discovery_cbs); oc_discovery_cb_t *cb = (oc_discovery_cb_t *)oc_list_head(oc_discovery_cbs);
while (cb) { while (cb) {
free_discovery_cb(cb); free_discovery_cb(cb);
cb = (oc_discovery_cb_t *)oc_list_pop(oc_discovery_cbs); cb = (oc_discovery_cb_t *)oc_list_head(oc_discovery_cbs);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment