This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/7078] New: when use if_freenameindex(NULL),we got a signal(11) error
- From: "yanghy at cn dot fujitsu dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 8 Dec 2008 01:54:17 -0000
- Subject: [Bug libc/7078] New: when use if_freenameindex(NULL),we got a signal(11) error
- Reply-to: sourceware-bugzilla at sourceware dot org
when use if_freenameindex(NULL),we got a signal(11) error.
Here is an attached patch:
---
sysdeps/unix/sysv/linux/if_index.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/if_index.c b/sysdeps/unix/sysv/linux/if_index.c
index 66f0ac1..6414e0f 100644
--- a/sysdeps/unix/sysv/linux/if_index.c
+++ b/sysdeps/unix/sysv/linux/if_index.c
@@ -73,6 +73,8 @@ void
if_freenameindex (struct if_nameindex *ifn)
{
struct if_nameindex *ptr = ifn;
+
+ if (ptr == NULL) return;
while (ptr->if_name || ptr->if_index)
{
free (ptr->if_name);
--
1.5.3.8
--
Summary: when use if_freenameindex(NULL),we got a signal(11)
error
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P1
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: yanghy at cn dot fujitsu dot com
CC: glibc-bugs at sources dot redhat dot com,yanghy at cn
dot fujitsu dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=7078
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.