Skip to content

Commit

Permalink
Close event file descriptor on enqueue failure (#193)
Browse files Browse the repository at this point in the history
Co-authored-by: sbrzozowski <sbrzozowski@hubspot.com>
  • Loading branch information
stevenbrz and sbrzozowski committed Jun 24, 2022
1 parent f08e108 commit 2b3116e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/daemon/notify.c
Expand Up @@ -322,8 +322,10 @@ static void *decision_thread_main(void *arg)

static void enqueue_event(const struct fanotify_event_metadata *metadata)
{
if (q_append(q, metadata))
if (q_append(q, metadata)){
msg(LOG_DEBUG, "enqueue error");
close(metadata->fd);
}
else
set_ready();
}
Expand Down

0 comments on commit 2b3116e

Please sign in to comment.