From 82ae72a0cf0ee3aee89573d79f1baffda3612593 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 27 Sep 2005 11:59:39 +0000 Subject: r10535: fixed the pidfile code (it didn't survive the recent pstring changes) (This used to be commit 1b9e6579931c9ff367ab032d0d2aadf95dcb3e63) --- source4/lib/pidfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/lib') 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; } -- cgit