execute: free directory path if we fail to remove it because we cannot allocate a thread

Based on 98b47d54ce.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2014-03-05 00:44:23 -05:00
parent 6772933b7f
commit b0e7aa5558
+7 -1
View File
@@ -1611,10 +1611,16 @@ void exec_context_tmp_dirs_done(ExecContext *c) {
c->tmp_dir ? c->var_tmp_dir : NULL,
NULL};
char **dirp;
int r;
for(dirp = dirs; *dirp; dirp++) {
log_debug("Spawning thread to nuke %s", *dirp);
asynchronous_job(remove_tmpdir_thread, *dirp);
r = asynchronous_job(remove_tmpdir_thread, *dirp);
if (r < 0) {
log_warning("Failed to nuke %s: %s", *dirp, strerror(-r));
free(*dirp);
}
}
c->tmp_dir = c->var_tmp_dir = NULL;