]> arthur.barton.de Git - netdata.git/blobdiff - src/daemon.c
improvements identified via static code analysis with cppcheck
[netdata.git] / src / daemon.c
index fb57be141d6da1801650d7112a242c4ad4f73034..2453012e87ede4859a43183b8a8bb20a060c3841 100644 (file)
@@ -114,7 +114,6 @@ int become_user(const char *username, int pid_fd)
             error("Cannot set supplementary groups for user '%s'", username);
 
         freez(supplementary_groups);
-        supplementary_groups = NULL;
         ngroups = 0;
     }
 
@@ -251,10 +250,8 @@ int become_daemon(int dont_fork, const char *user)
         create_needed_dir(VARLIB_DIR, getuid(), getgid());
     }
 
-    if(pidfd != -1) {
+    if(pidfd != -1)
         close(pidfd);
-        pidfd = -1;
-    }
 
     return(0);
 }