mirror of
https://github.com/coturn/coturn.git
synced 2025-10-25 21:11:00 +02:00
Fix memory leak in netengine.c (#1411)
This is in response to issue #1366 The clang static analyzer basically claims that there is a memory leak happening in `set_ssl_ctx` for the variable `args`. The leak is triggered when the base event `base` is NULL and the condition within `set_ssl_ctx` is not triggered. Therefore as a patch I am adding an else condition to free it. (It cannot be freed after the event is created by `event_new` because `args` can be invoked as argument for callback function later on) Please let me know if this patch is helpful :) --------- Co-authored-by: Pavel Punsky <eakraly@users.noreply.github.com>
This commit is contained in:
parent
68b9f19f7f
commit
456e2e81b3
@ -349,6 +349,10 @@ void set_ssl_ctx(ioa_engine_handle e, turn_params_t *params) {
|
|||||||
args->next = params->tls_ctx_update_ev;
|
args->next = params->tls_ctx_update_ev;
|
||||||
params->tls_ctx_update_ev = ev;
|
params->tls_ctx_update_ev = ev;
|
||||||
TURN_MUTEX_UNLOCK(&turn_params.tls_mutex);
|
TURN_MUTEX_UNLOCK(&turn_params.tls_mutex);
|
||||||
|
} else {
|
||||||
|
if (args) {
|
||||||
|
free(args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user