common: Set pointer to NULL after freeing them

pull/185/merge 0.4.4
Olivier Martin 2024-02-27 11:28:49 +01:00
parent d2702050ec
commit 00cbc1ab87
3 changed files with 4 additions and 0 deletions

View File

@ -62,6 +62,7 @@ static gpointer _gattlib_discovered_device_thread(gpointer data) {
free(args->mac_address);
if (args->name != NULL) {
free(args->name);
args->name = NULL;
}
free(args);
return NULL;

View File

@ -61,9 +61,11 @@ void gattlib_notification_device_thread(gpointer data, gpointer user_data) {
if (args->uuid != NULL) {
free(args->uuid);
args->uuid = NULL;
}
if (args->data != NULL) {
free(args->data);
args->data = NULL;
}
}

View File

@ -151,6 +151,7 @@ void gattlib_handler_free(struct gattlib_handler* handler) {
Py_DECREF(args->args);
handler->python_args = NULL;
free(handler->python_args);
handler->python_args = NULL;
}
if (handler->thread_pool != NULL) {