From 8d52247a4e0cbcd583f295cf44dd7b2572e9d5bd Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 8 Sep 2015 16:46:27 +0200 Subject: [PATCH] notify_systemd: unset NOTIFY_SOCKET later getenv returns a pointer, possibly to a static buffer. If I understand the specs correctly, unsetenv is basically free to do what it wants with this, so don't keep using the pointer after we do unsetenv. --- src/daemon/collectd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c index df238e71..fc529331 100644 --- a/src/daemon/collectd.c +++ b/src/daemon/collectd.c @@ -501,6 +501,7 @@ int notify_systemd (void) return 0; } + unsetenv ("NOTIFY_SOCKET"); close(fd); return 1; } -- 2.30.2