summaryrefslogtreecommitdiff
path: root/source4/lib/pidfile.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-09-27 11:59:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:03 -0500
commit82ae72a0cf0ee3aee89573d79f1baffda3612593 (patch)
tree7456e85516e138781ef3810eac4cc6d19f88d9a2 /source4/lib/pidfile.c
parent04b7fb64e1e84f6c2cf987eb6497e2d25727a59d (diff)
downloadsamba-82ae72a0cf0ee3aee89573d79f1baffda3612593.tar.gz
samba-82ae72a0cf0ee3aee89573d79f1baffda3612593.tar.bz2
samba-82ae72a0cf0ee3aee89573d79f1baffda3612593.zip
r10535: fixed the pidfile code (it didn't survive the recent pstring changes)
(This used to be commit 1b9e6579931c9ff367ab032d0d2aadf95dcb3e63)
Diffstat (limited to 'source4/lib/pidfile.c')
-rw-r--r--source4/lib/pidfile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/lib/pidfile.c b/source4/lib/pidfile.c
index 54d2c81d2e..9a7c197f70 100644
--- a/source4/lib/pidfile.c
+++ b/source4/lib/pidfile.c
@@ -39,9 +39,9 @@ pid_t pidfile_pid(const char *name)
asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name);
fd = open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
- SAFE_FREE(pidFile);
if (fd == -1) {
+ SAFE_FREE(pidFile);
return 0;
}
@@ -63,11 +63,13 @@ pid_t pidfile_pid(const char *name)
}
close(fd);
+ SAFE_FREE(pidFile);
return (pid_t)ret;
noproc:
close(fd);
unlink(pidFile);
+ SAFE_FREE(pidFile);
return 0;
}