diff --git a/coreapi/logging.c b/coreapi/logging.c index 5eef11ce7..7c4a213b3 100644 --- a/coreapi/logging.c +++ b/coreapi/logging.c @@ -127,6 +127,7 @@ static void _log_handler_on_message_written_cb(void *info,const char *domain, Bc static void _log_handler_destroy_cb(bctbx_log_handler_t *handler) { LinphoneLoggingService *service = (LinphoneLoggingService *)bctbx_log_handler_get_user_data(handler); + bctbx_free(service->log_handler); service->log_handler = NULL; } @@ -162,7 +163,8 @@ void linphone_logging_service_unref(LinphoneLoggingService *service) { } static void _linphone_logging_service_uninit(LinphoneLoggingService *log_service) { - if (log_service->log_handler) bctbx_remove_log_handler(log_service->log_handler); + if (log_service->log_handler) + bctbx_remove_log_handler(log_service->log_handler); linphone_logging_service_cbs_unref(log_service->cbs); }