mirror of
https://github.com/openssl/openssl.git
synced 2025-03-01 14:46:32 +08:00
EVENT QUEUE: Fix memory leak (coverity)
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21565)
This commit is contained in:
parent
565d2987cd
commit
77a66117ab
@ -111,8 +111,11 @@ OSSL_EVENT *ossl_event_queue_add_new(OSSL_EVENT_QUEUE *queue,
|
||||
{
|
||||
OSSL_EVENT *e = OPENSSL_malloc(sizeof(*e));
|
||||
|
||||
if (e == NULL || queue == NULL)
|
||||
if (e == NULL || queue == NULL) {
|
||||
OPENSSL_free(e);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ossl_event_set(e, type, priority, when, ctx, payload, payload_size);
|
||||
e->flag_dynamic = 1;
|
||||
if (event_queue_add(queue, e))
|
||||
|
Loading…
Reference in New Issue
Block a user