Fix memory leak on error

The variable condition was not destroyed on strdup() failure.
master
Romain Vimont 7 years ago
parent e1afd9f8b0
commit 507b0bcccf

@ -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;
}

Loading…
Cancel
Save