summaryrefslogtreecommitdiff
path: root/ninfod
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2012-12-20 05:17:23 +0900
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2012-12-20 05:20:05 +0900
commit3fc2932d6c646677530a31fd41078a8bf1f2b170 (patch)
tree4278207853731a616b59ed7b9d4215db41f4284c /ninfod
parentb167c9b77bc5a7483ab5582e5a5845d1ff6569c4 (diff)
downloadiputils-3fc2932d6c646677530a31fd41078a8bf1f2b170.tar.gz
ninfod: Fix memory leakage in error path.
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 4225a5a..45d22d0 100644
--- a/ninfod/ni_ifaddrs.c
+++ b/ninfod/ni_ifaddrs.c
@@ -171,6 +171,7 @@ static int nl_getmsg(int sd, int request, int seq, struct nlmsghdr **nlhp, int *
for (;;) {
void *newbuff = realloc(buff, bufsize);
if (newbuff == NULL || bufsize < lastbufsize) {
+ free(newbuff);
result = -1;
break;
}