Permalink
Browse files

FR-GV-203 - fix memory leak when using decode_tlv()

  • Loading branch information...
alandekok committed Jul 3, 2017
1 parent ae3ba00 commit ef0727fc68e211a36637b5c4e4a6fa1326f0a029
Showing with 2 additions and 1 deletion.
  1. +2 −1 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];
}

0 comments on commit ef0727f

Please sign in to comment.