]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:util: Initialize pid
authorAndreas Schneider <asn@samba.org>
Tue, 14 Dec 2021 15:13:51 +0000 (16:13 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 15 Dec 2021 19:32:30 +0000 (19:32 +0000)
Found by covscan

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/pidfile.c

index 4f4e5e9782c9471d1468a6387346517e20d27732..6ffbbeac5ee35537551099a0c391984cc0bf130e 100644 (file)
@@ -207,7 +207,7 @@ void pidfile_create(const char *piddir, const char *name)
 {
        size_t len = strlen(piddir) + strlen(name) + 6;
        char pidFile[len];
-       pid_t pid;
+       pid_t pid = (pid_t)-1;
        int ret, fd;
 
        snprintf(pidFile, sizeof(pidFile), "%s/%s.pid", piddir, name);