ecore_wl2: Make offer destroy more secure

Check if it is NULL and NULL after each destroy call
This commit is contained in:
Marcel Hollerbach 2016-07-06 20:10:05 +02:00
parent 75bb8060b3
commit f0325fc190
1 changed files with 6 additions and 1 deletions

View File

@ -246,6 +246,7 @@ _selection_data_read(void *data, Ecore_Fd_Handler *fdh)
WL_DATA_OFFER_FINISH_SINCE_VERSION)
wl_data_offer_finish(source->offer);
wl_data_offer_destroy(source->offer);
source->offer = NULL;
}
fd = ecore_main_fd_handler_fd_get(source->fdh);
@ -487,7 +488,11 @@ _ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source)
close(ecore_main_fd_handler_fd_get(source->fdh));
ecore_main_fd_handler_del(source->fdh);
}
wl_data_offer_destroy(source->offer);
if (source->offer)
{
wl_data_offer_destroy(source->offer);
source->offer = NULL;
}
wl_array_release(&source->types);
free(source);
}