Page MenuHomeFreeBSD

D53545.diff
No OneTemporary

D53545.diff

diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c
--- a/sbin/ifconfig/ifbridge.c
+++ b/sbin/ifconfig/ifbridge.c
@@ -811,7 +811,7 @@
static int
parse_vlans(ifbvlan_set_t *set, const char *str)
{
- char *s, *token;
+ char *s, *free_s, *token;
/* "none" means the empty vlan set */
if (strcmp(str, "none") == 0) {
@@ -829,6 +829,8 @@
if ((s = strdup(str)) == NULL)
return (-1);
+ /* Keep the original value of s, since strsep() will modify it */
+ free_s = s;
while ((token = strsep(&s, ",")) != NULL) {
unsigned long first, last;
@@ -856,11 +858,11 @@
BRVLAN_SET(set, vlan);
}
- free(s);
+ free(free_s);
return (0);
err:
- free(s);
+ free(free_s);
return (-1);
}

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 1, 2:21 PM (2 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24735028
Default Alt Text
D53545.diff (718 B)

Event Timeline