From f3285f86f512ec05d101b4b995733180c4a71883 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 26 Jul 2004 15:22:56 +0000 Subject: Update. 2004-07-26 Ulrich Drepper * sysdeps/unix/sysv/linux/ifreq.c (__ifreq): Assign pointer for new buffer at the right time. Reported by Jakub Bogusz . --- sysdeps/unix/sysv/linux/ifreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/unix/sysv/linux/ifreq.c') diff --git a/sysdeps/unix/sysv/linux/ifreq.c b/sysdeps/unix/sysv/linux/ifreq.c index b93cd56eab..098f11750f 100644 --- a/sysdeps/unix/sysv/linux/ifreq.c +++ b/sysdeps/unix/sysv/linux/ifreq.c @@ -71,7 +71,8 @@ __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd) { ifc.ifc_len = rq_len; void *newp = realloc (ifc.ifc_buf, ifc.ifc_len); - if (newp == NULL || __ioctl (fd, SIOCGIFCONF, &ifc) < 0) + if (newp == NULL + || (ifc.ifc_buf = newp, __ioctl (fd, SIOCGIFCONF, &ifc)) < 0) { free (ifc.ifc_buf); @@ -82,7 +83,6 @@ __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd) *ifreqs = NULL; return; } - ifc.ifc_buf = newp; if (!old_siocgifconf || ifc.ifc_len < rq_len) break; -- cgit v1.2.3