From a3ab92226d96669e10b659bf559e50e64fe4a205 Mon Sep 17 00:00:00 2001 From: npes87184 Date: Sun, 12 Aug 2018 09:20:06 +0800 Subject: [PATCH] Destroy mutex if strdup failed Signed-off-by: npes87184 --- app/src/installer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/installer.c b/app/src/installer.c index fcb41fc9..b4789297 100644 --- a/app/src/installer.c +++ b/app/src/installer.c @@ -69,6 +69,7 @@ SDL_bool installer_init(struct installer *installer, const char *serial) { installer->serial = SDL_strdup(serial); if (!installer->serial) { LOGW("Cannot strdup serial"); + SDL_DestroyMutex(installer->mutex); return SDL_FALSE; } } else {