diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-02-03 12:11:30 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-02-03 12:11:30 +0100 |
commit | a97777889328157bb7d06ec618bad16712a9c345 (patch) | |
tree | 3ba4405726ee5c9c03a1f6fedfde377d78ef2e67 | |
parent | 8e74adab0107658e3dc04ed342206272a284f43e (diff) | |
download | busybox-w32-a97777889328157bb7d06ec618bad16712a9c345.tar.gz busybox-w32-a97777889328157bb7d06ec618bad16712a9c345.tar.bz2 busybox-w32-a97777889328157bb7d06ec618bad16712a9c345.zip |
ifconfig: fix double free fatal error in INET_sprint
Based on the patch by Zheng Junling <zhengjunling@huawei.com>
and Chen Gang <cg.chen@huawei.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/interface.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
91 | { | 91 | { |
92 | static char *buff; /* defaults to NULL */ | 92 | static char *buff; /* defaults to NULL */ |
93 | 93 | ||
94 | free(buff); | ||
95 | if (sap->sa_family == 0xFFFF || sap->sa_family == 0) | 94 | if (sap->sa_family == 0xFFFF || sap->sa_family == 0) |
96 | return "[NONE SET]"; | 95 | return "[NONE SET]"; |
96 | free(buff); | ||
97 | buff = INET_rresolve((struct sockaddr_in *) sap, numeric, 0xffffff00); | 97 | buff = INET_rresolve((struct sockaddr_in *) sap, numeric, 0xffffff00); |
98 | return buff; | 98 | return buff; |
99 | } | 99 | } |
@@ -173,9 +173,9 @@ static const char* FAST_FUNC INET6_sprint(struct sockaddr *sap, int numeric) | |||
173 | { | 173 | { |
174 | static char *buff; | 174 | static char *buff; |
175 | 175 | ||
176 | free(buff); | ||
177 | if (sap->sa_family == 0xFFFF || sap->sa_family == 0) | 176 | if (sap->sa_family == 0xFFFF || sap->sa_family == 0) |
178 | return "[NONE SET]"; | 177 | return "[NONE SET]"; |
178 | free(buff); | ||
179 | buff = INET6_rresolve((struct sockaddr_in6 *) sap, numeric); | 179 | buff = INET6_rresolve((struct sockaddr_in6 *) sap, numeric); |
180 | return buff; | 180 | return buff; |
181 | } | 181 | } |