From: Ruben Kerkhof Date: Tue, 8 Sep 2015 14:46:27 +0000 (+0200) Subject: notify_systemd: unset NOTIFY_SOCKET later X-Git-Tag: collectd-5.6.0~591^2~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8d52247a4e0cbcd583f295cf44dd7b2572e9d5bd;p=collectd.git 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. --- 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; }