dt = strjoin(d, "/tmp", NULL);
if (!dt) {
r = log_oom();
- goto fail2;
+ goto fail3;
}
umask(0000);
if (r) {
log_error("Can't create directory %s: %m", dt);
r = -errno;
- goto fail1;
+ goto fail2;
}
log_debug("Created temporary directory %s", dt);
fail1:
rmdir(dt);
fail2:
+ free(dt);
+fail3:
rmdir(template);
return r;
}