This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/7078] New: when use if_freenameindex(NULL),we got a signal(11) error


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]