scan: Zero destroy callback in scan_cancel

Otherwise it may be called again in get_scan_done.
This commit is contained in:
Andrew Zaborowski 2016-09-21 18:54:53 +02:00 committed by Denis Kenzior
parent 6d11ce020a
commit c6e38dacac
1 changed files with 3 additions and 1 deletions

View File

@ -375,8 +375,10 @@ bool scan_cancel(uint32_t ifindex, uint32_t id)
if (sr->id == id && sr->triggered) {
sr->callback = NULL;
if (sr->destroy)
if (sr->destroy) {
sr->destroy(sr->userdata);
sr->destroy = NULL;
}
return true;
}