From df28d9d7f9eabd2373df031fa2939d0b41ee6caa Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 13 Mar 2015 08:44:04 -0400 Subject: splint/cppcheck/coverity prerelease cleanup. --- gpsd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gpsd.c') diff --git a/gpsd.c b/gpsd.c index 9526ead5..aafb126f 100644 --- a/gpsd.c +++ b/gpsd.c @@ -1966,7 +1966,7 @@ int main(int argc, char *argv[]) } /*@+unrecog@*/ - if (pid_file) { + if (pid_file != NULL) { FILE *fp; if ((fp = fopen(pid_file, "w")) != NULL) { @@ -1991,7 +1991,8 @@ int main(int argc, char *argv[]) gpsd_log(&context.errout, LOG_ERR, "command sockets creation failed, netlib errors %d, %d\n", msocks[0], msocks[1]); - (void)unlink(pid_file); + if (pid_file != NULL) + (void)unlink(pid_file); exit(EXIT_FAILURE); } gpsd_log(&context.errout, LOG_INF, "listening on port %s\n", gpsd_service); -- cgit v1.2.1