From: Denys Vlasenko Date: Tue, 3 Feb 2015 11:11:30 +0000 (+0100) Subject: ifconfig: fix double free fatal error in INET_sprint X-Git-Tag: 1_24_0~206 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a97777889328157bb7d06ec618bad16712a9c345;p=oweals%2Fbusybox.git ifconfig: fix double free fatal error in INET_sprint Based on the patch by Zheng Junling and Chen Gang Signed-off-by: Denys Vlasenko --- diff --git a/networking/interface.c b/networking/interface.c index bf7d2b1b4..b0572d04e 100644 --- a/networking/interface.c +++ b/networking/interface.c @@ -91,9 +91,9 @@ static const char* FAST_FUNC INET_sprint(struct sockaddr *sap, int numeric) { static char *buff; /* defaults to NULL */ - free(buff); if (sap->sa_family == 0xFFFF || sap->sa_family == 0) return "[NONE SET]"; + free(buff); buff = INET_rresolve((struct sockaddr_in *) sap, numeric, 0xffffff00); return buff; } @@ -173,9 +173,9 @@ static const char* FAST_FUNC INET6_sprint(struct sockaddr *sap, int numeric) { static char *buff; - free(buff); if (sap->sa_family == 0xFFFF || sap->sa_family == 0) return "[NONE SET]"; + free(buff); buff = INET6_rresolve((struct sockaddr_in6 *) sap, numeric); return buff; }