From: Arran Cudbard-Bell Date: Wed, 20 Feb 2013 17:44:36 +0000 (-0500) Subject: Use talloc to allocate tlvs in dhcp.c X-Git-Tag: release_3_0_0_beta1~841 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f92851eea5452f339060112e6c1faf01737bc031;p=thirdparty%2Ffreeradius-server.git Use talloc to allocate tlvs in dhcp.c --- diff --git a/src/lib/dhcp.c b/src/lib/dhcp.c index e4bf140e94d..f0ca90d860b 100644 --- a/src/lib/dhcp.c +++ b/src/lib/dhcp.c @@ -498,7 +498,7 @@ static int decode_tlv(VALUE_PAIR *tlv, const uint8_t *data, size_t data_len) return 0; make_tlv: - tlv->vp_tlv = malloc(data_len); + tlv->vp_tlv = talloc_array(tlv, uint8_t, data_len); if (!tlv->vp_tlv) { fr_strerror_printf("No memory"); return -1; @@ -988,7 +988,7 @@ static VALUE_PAIR *fr_dhcp_vp2suboption(VALUE_PAIR *vps) return NULL; } - tlv->vp_tlv = malloc(tlv->length); + tlv->vp_tlv = talloc_array(tlv, uint8_t, tlv->length); if (!tlv->vp_tlv) { pairfree(&tlv); return NULL;