Cleanup task_decompress

This commit is contained in:
twinaphex 2019-05-12 20:17:58 +02:00
parent 0302a8812a
commit ba8f7e3e63

View File

@ -323,19 +323,23 @@ bool task_push_decompress(
s = (decompress_state_t*)calloc(1, sizeof(*s));
if (!s)
goto error;
return false;
t = (retro_task_t*)calloc(1, sizeof(*t));
if (!t)
{
free(s);
return false;
}
s->source_file = strdup(source_file);
s->target_dir = strdup(target_dir);
s->valid_ext = valid_ext ? strdup(valid_ext) : NULL;
s->archive.type = ARCHIVE_TRANSFER_INIT;
s->userdata = (struct archive_extract_userdata*)calloc(1, sizeof(*s->userdata));
t = (retro_task_t*)calloc(1, sizeof(*t));
if (!t)
goto error;
s->userdata = (struct archive_extract_userdata*)
calloc(1, sizeof(*s->userdata));
t->frontend_userdata= frontend_userdata;
@ -365,13 +369,4 @@ bool task_push_decompress(
task_queue_push(t);
return true;
error:
if (s)
{
if (s->userdata)
free(s->userdata);
free(s);
}
return false;
}