Delete the output file upon errors
This commit is contained in:
parent
440d9618c8
commit
ea9fc2b0f4
|
@ -372,11 +372,15 @@ static int _common_task_save_buffer_as(CommonTask * task, char const * filename)
|
|||
{
|
||||
g_free(buf);
|
||||
fclose(fp);
|
||||
unlink(filename);
|
||||
return -_common_task_error(task, strerror(errno), 1);
|
||||
}
|
||||
g_free(buf);
|
||||
if(fclose(fp) != 0)
|
||||
{
|
||||
unlink(filename);
|
||||
return -_common_task_error(task, strerror(errno), 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user