mirror of
https://github.com/libretro/RetroArch.git
synced 2024-10-07 22:33:27 +00:00
Cleanup task_decompress
This commit is contained in:
parent
0302a8812a
commit
ba8f7e3e63
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user