Skip to content

Commit 7ef618d

Browse files
committed
Unlock mutex on event update failure paths
1 parent 066f3e2 commit 7ef618d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/events.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ WOLFSENTRY_API wolfsentry_errcode_t wolfsentry_event_update_config(WOLFSENTRY_CO
363363
WOLFSENTRY_MUTEX_OR_RETURN();
364364

365365
ret = wolfsentry_event_get_1(WOLFSENTRY_CONTEXT_ARGS_OUT, label, label_len, &event);
366-
WOLFSENTRY_RERETURN_IF_ERROR(ret);
366+
WOLFSENTRY_UNLOCK_AND_RERETURN_IF_ERROR(ret);
367367

368368
if (event->config == NULL) {
369369
if ((event->config = (struct wolfsentry_eventconfig_internal *)WOLFSENTRY_MALLOC(sizeof *event->config)) == NULL)
@@ -618,7 +618,7 @@ WOLFSENTRY_API wolfsentry_errcode_t wolfsentry_event_set_aux_event(
618618
WOLFSENTRY_MUTEX_OR_RETURN();
619619

620620
ret = wolfsentry_event_get_reference(WOLFSENTRY_CONTEXT_ARGS_OUT, event_label, event_label_len, &event);
621-
WOLFSENTRY_RERETURN_IF_ERROR(ret);
621+
WOLFSENTRY_UNLOCK_AND_RERETURN_IF_ERROR(ret);
622622
if (WOLFSENTRY_CHECK_BITS(event->flags, WOLFSENTRY_EVENT_FLAG_IS_SUBEVENT)) {
623623
ret = WOLFSENTRY_ERROR_ENCODE(INCOMPATIBLE_STATE);
624624
goto out;

0 commit comments

Comments
 (0)