From fdf14ae2e653f275c085329b183373e1fb062693 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 5 Sep 2009 23:37:40 +0200 Subject: do not save/restore errno around free() calls In any non-buggy program free() does not fail. And when it fails in a buggy program, the failure is usually fatal (heap corruption and segfault). Signed-off-by: Denys Vlasenko --- libc/inet/ifaddrs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libc/inet/ifaddrs.c') diff --git a/libc/inet/ifaddrs.c b/libc/inet/ifaddrs.c index 1d54d5123..77ca7ce02 100644 --- a/libc/inet/ifaddrs.c +++ b/libc/inet/ifaddrs.c @@ -81,7 +81,6 @@ void __netlink_free_handle (struct netlink_handle *h) { struct netlink_res *ptr; - int saved_errno = errno; ptr = h->nlm_list; while (ptr != NULL) @@ -89,11 +88,9 @@ __netlink_free_handle (struct netlink_handle *h) struct netlink_res *tmpptr; tmpptr = ptr->next; - free (ptr); + free (ptr); /* doesn't affect errno */ ptr = tmpptr; } - - __set_errno (saved_errno); } -- cgit v1.2.3