From 507b0bcccf708ef0a4b732d9165e882df4330bd9 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 29 May 2019 21:33:34 +0200 Subject: [PATCH] Fix memory leak on error The variable condition was not destroyed on strdup() failure. --- app/src/file_handler.c | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/file_handler.c b/app/src/file_handler.c index c72b598d..79763c6e 100644 --- a/app/src/file_handler.c +++ b/app/src/file_handler.c @@ -100,6 +100,7 @@ file_handler_init(struct file_handler *file_handler, const char *serial) { file_handler->serial = SDL_strdup(serial); if (!file_handler->serial) { LOGW("Cannot strdup serial"); + SDL_DestroyCond(file_handler->event_cond); SDL_DestroyMutex(file_handler->mutex); return false; }