Fixed coverity issue 1047596
authorArmin Novak <anovak@thinstuff.com>
Wed, 28 Aug 2013 15:51:43 +0000 (17:51 +0200)
committerArmin Novak <anovak@thinstuff.com>
Thu, 5 Sep 2013 10:14:32 +0000 (12:14 +0200)
winpr/libwinpr/synch/event.c

index ece585c..3b96127 100644 (file)
@@ -70,12 +70,14 @@ HANDLE CreateEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
                if (event->pipe_fd[0] < 0)
                {
                        fprintf(stderr, "CreateEventW: failed to create event\n");
+                       free(event);
                        return NULL;
                }
 #else
                if (pipe(event->pipe_fd) < 0)
                {
                        fprintf(stderr, "CreateEventW: failed to create event\n");
+                       free(event);
                        return NULL;
                }
 #endif