summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2017-05-14 13:59:40 +0000
committermarius <marius@FreeBSD.org>2017-05-14 13:59:40 +0000
commit9a93b57e4d02d1584cdfc998b04abeb106d797f8 (patch)
tree2586eadbb648e85c3309abccd644a8d96de557b1 /sbin/ipfw
parent1c1ebad8cca2a2ff8e580843e26756f7e4ffe2b0 (diff)
downloadFreeBSD-src-9a93b57e4d02d1584cdfc998b04abeb106d797f8.zip
FreeBSD-src-9a93b57e4d02d1584cdfc998b04abeb106d797f8.tar.gz
MFC: r317343
In fill_ip6(), the value of the pointer av changes before it is free(3)ed. Thus, introduce a new variable to track the original value.
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/ipv6.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/ipfw/ipv6.c b/sbin/ipfw/ipv6.c
index ee9bb62..d028ffc 100644
--- a/sbin/ipfw/ipv6.c
+++ b/sbin/ipfw/ipv6.c
@@ -338,6 +338,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen)
{
int len = 0;
struct in6_addr *d = &(cmd->addr6);
+ char *oav;
/*
* Needed for multiple address.
* Note d[1] points to struct in6_add r mask6 of cmd
@@ -375,7 +376,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen)
return (1);
}
- av = strdup(av);
+ oav = av = strdup(av);
while (av) {
/*
* After the address we can have '/' indicating a mask,
@@ -451,7 +452,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen)
if (len + 1 > F_LEN_MASK)
errx(EX_DATAERR, "address list too long");
cmd->o.len |= len+1;
- free(av);
+ free(oav);
return (1);
}
OpenPOWER on IntegriCloud