diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-13 08:44:04 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-13 08:44:04 -0400 |
commit | df28d9d7f9eabd2373df031fa2939d0b41ee6caa (patch) | |
tree | 71ea48f96eeb2d42457764a0e64c0c109c92ffa7 /gpsd.c | |
parent | f0a7a853d5eac933f60b562f3b44102296c9e23f (diff) | |
download | gpsd-df28d9d7f9eabd2373df031fa2939d0b41ee6caa.tar.gz |
splint/cppcheck/coverity prerelease cleanup.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |