projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ae3ba00
)
FR-GV-203 - fix memory leak when using decode_tlv()
author
Alan T. DeKok
<aland@freeradius.org>
Mon, 3 Jul 2017 18:48:47 +0000
(14:48 -0400)
committer
Alan T. DeKok
<aland@freeradius.org>
Mon, 17 Jul 2017 12:22:18 +0000
(08:22 -0400)
src/lib/dhcp.c
patch
|
blob
|
history
diff --git
a/src/lib/dhcp.c
b/src/lib/dhcp.c
index
d7bba42
..
24578f0
100644
(file)
--- a/
src/lib/dhcp.c
+++ b/
src/lib/dhcp.c
@@
-478,12
+478,13
@@
static int decode_tlv(VALUE_PAIR *tlv, const uint8_t *data, size_t data_len)
}
if (fr_dhcp_attr2vp(vp, p + 2, p[1]) < 0) {
+ pairfree(&vp);
pairfree(&head);
goto make_tlv;
}
*tail = vp;
-
tail = &(vp
->next);
+
while (*tail) tail = &((*tail)
->next);
p += 2 + p[1];
}