From c43ae0e00ab6f37452ddc4128dc82a5da721f0ad Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 1 Jan 2016 23:44:08 +0100 Subject: bug fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/common.c | 1 + src/common.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/common.c b/src/common.c index a6f4c7c..6423937 100644 --- a/src/common.c +++ b/src/common.c @@ -417,6 +417,7 @@ poke_daemon(int start, const char *name) t (read(fd, &pid, sizeof(pid)) < (ssize_t)sizeof(pid)); close(fd), fd = -1; } + free(path), path = NULL; /* Start daemon if not running, otherwise poke it. */ if (start) { diff --git a/src/common.h b/src/common.h index 92dbaf4..0808e11 100644 --- a/src/common.h +++ b/src/common.h @@ -181,7 +181,7 @@ const char *argv0 = name; #define NO_OPTIONS \ do { \ int i; \ - if (!strcmp(argv[1], "--")) \ + if ((argc > 1) && !strcmp(argv[1], "--")) \ argv++, argc--; \ for (i = 1; i < argc; i++) \ if (strchr("-", argv[i][0])) \ -- cgit v1.2.3-70-g09d2