summaryrefslogtreecommitdiff
path: root/ninfod
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2012-12-20 05:22:58 +0900
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2012-12-20 05:49:54 +0900
commitdfa1ffd75a4871edbc1d08b69d9400e1a7c50593 (patch)
tree409a183a51fa1e2242462fe7613809219b0d1025 /ninfod
parent4f0e3c16aa7d2dd656bcc167052b64dd34a04428 (diff)
downloadiputils-dfa1ffd75a4871edbc1d08b69d9400e1a7c50593.tar.gz
ninfod: Do not expose freed buffer to caller.
This is safe because we return an error to the caller, and the caller does not use the buffer. But it is better not to expose such a invalid pointer to caller. Bug noticed by Jan Synacek <jsynacek@redhat.com>. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'ninfod')
-rw-r--r--ninfod/ni_ifaddrs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ninfod/ni_ifaddrs.c b/ninfod/ni_ifaddrs.c
index 45d22d0..4ee2838 100644
--- a/ninfod/ni_ifaddrs.c
+++ b/ninfod/ni_ifaddrs.c
@@ -208,6 +208,7 @@ static int nl_getmsg(int sd, int request, int seq, struct nlmsghdr **nlhp, int *
if (buff) {
int saved_errno = errno;
free(buff);
+ buff = NULL;
errno = saved_errno;
}
*nlhp = (struct nlmsghdr *) buff;