From 0c7537c8401daf7373972d047607a4e512687629 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 11 Apr 2024 13:26:15 +0200 Subject: [PATCH] [coverity] 1543230 Missing unlock --- winpr/libwinpr/utils/collections/PubSub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winpr/libwinpr/utils/collections/PubSub.c b/winpr/libwinpr/utils/collections/PubSub.c index 0efffb741..b95f26d02 100644 --- a/winpr/libwinpr/utils/collections/PubSub.c +++ b/winpr/libwinpr/utils/collections/PubSub.c @@ -102,7 +102,7 @@ void PubSub_AddEventTypes(wPubSub* pubSub, wEventType* events, size_t count) new_size = pubSub->size * 2; new_event = (wEventType*)realloc(pubSub->events, new_size * sizeof(wEventType)); if (!new_event) - return; + goto fail; pubSub->size = new_size; pubSub->events = new_event; } @@ -110,6 +110,7 @@ void PubSub_AddEventTypes(wPubSub* pubSub, wEventType* events, size_t count) CopyMemory(&pubSub->events[pubSub->count], events, count * sizeof(wEventType)); pubSub->count += count; +fail: if (pubSub->synchronized) PubSub_Unlock(pubSub); }