Permalink
Browse files

FR-GV-204 - free VP if decoding options fails, so we don't leak memory

  • Loading branch information...
alandekok committed Jul 1, 2017
1 parent ef0727f commit 812766e2150faa07b4c574e51393b014feaffe6c
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/lib/dhcp.c
@@ -792,6 +792,7 @@ int fr_dhcp_decode(RADIUS_PACKET *packet)
*/
if (fr_dhcp_decode_options(packet->data + 240, packet->data_len - 240,
tail) < 0) {
pairfree(&head);
return -1;
}

@@ -1451,6 +1452,7 @@ int fr_dhcp_encode(RADIUS_PACKET *packet)
* limitations: sizeof(vp->vp_octets) < 255
*/
if (length > 255) {
pairfree(&vp);
fr_strerror_printf("WARNING Ignoring too long attribute %s!", vp->name);
break;
}

0 comments on commit 812766e

Please sign in to comment.