diff options
author | marius <marius@FreeBSD.org> | 2017-05-14 13:59:36 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2017-05-14 13:59:36 +0000 |
commit | 212b9baa3d46447fee3cba507fa1b734842a2af9 (patch) | |
tree | ca70bfdbc2cb3f6cf1911341db0c75cb61752b68 /sbin | |
parent | 25b2f7c243634889a984bcad3ed50509fce73ded (diff) | |
download | FreeBSD-src-212b9baa3d46447fee3cba507fa1b734842a2af9.zip FreeBSD-src-212b9baa3d46447fee3cba507fa1b734842a2af9.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')
-rw-r--r-- | sbin/ipfw/ipv6.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/ipfw/ipv6.c b/sbin/ipfw/ipv6.c index fca666d..4fce1d2 100644 --- a/sbin/ipfw/ipv6.c +++ b/sbin/ipfw/ipv6.c @@ -339,6 +339,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, struct tidx *tstate) { 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 @@ -365,7 +366,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, struct tidx *tstate) return (1); } - av = strdup(av); + oav = av = strdup(av); while (av) { /* * After the address we can have '/' indicating a mask, @@ -446,7 +447,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, struct tidx *tstate) if (len + 1 > F_LEN_MASK) errx(EX_DATAERR, "address list too long"); cmd->o.len |= len+1; - free(av); + free(oav); return (1); } |