chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
ebf4fb3
)
shared: free dt (temporary dir name) on fail
author
Václav Pavlín
<vpavlin@redhat.com>
Wed, 27 Mar 2013 14:16:37 +0000
(15:16 +0100)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Wed, 27 Mar 2013 16:01:44 +0000
(12:01 -0400)
[zj: modified to not to try to rmdir() dir we haven't created.]
src/shared/util.c
patch
|
blob
|
history
diff --git
a/src/shared/util.c
b/src/shared/util.c
index 0444cf44561360d20f0589e17283c5517fc77ee2..8fa01fa8a49609baf640ef850da891ac19dfcb85 100644
(file)
--- a/
src/shared/util.c
+++ b/
src/shared/util.c
@@
-5708,7
+5708,7
@@
int create_tmp_dir(char template[], char** dir_name) {
dt = strjoin(d, "/tmp", NULL);
if (!dt) {
r = log_oom();
- goto fail
2
;
+ goto fail
3
;
}
umask(0000);
@@
-5716,7
+5716,7
@@
int create_tmp_dir(char template[], char** dir_name) {
if (r) {
log_error("Can't create directory %s: %m", dt);
r = -errno;
- goto fail
1
;
+ goto fail
2
;
}
log_debug("Created temporary directory %s", dt);
@@
-5734,6
+5734,8
@@
int create_tmp_dir(char template[], char** dir_name) {
fail1:
rmdir(dt);
fail2:
+ free(dt);
+fail3:
rmdir(template);
return r;
}