From: Alan T. DeKok Date: Tue, 29 Oct 2019 18:34:19 +0000 (-0400) Subject: delay allocation of tmp_ctx until we need it X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb9deb68cf34d56eda747080f1cb204057b8fdc3;p=thirdparty%2Ffreeradius-server.git delay allocation of tmp_ctx until we need it --- diff --git a/src/protocols/dhcpv6/base.c b/src/protocols/dhcpv6/base.c index 283481e87bb..1bfaa1e6429 100644 --- a/src/protocols/dhcpv6/base.c +++ b/src/protocols/dhcpv6/base.c @@ -361,8 +361,6 @@ ssize_t fr_dhcpv6_decode(TALLOC_CTX *ctx, uint8_t const *packet, size_t packet_l fr_dhcpv6_decode_ctx_t packet_ctx; VALUE_PAIR *vp; - packet_ctx.tmp_ctx = talloc_init("tmp"); - fr_cursor_init(&cursor, vps); /* @@ -407,6 +405,8 @@ ssize_t fr_dhcpv6_decode(TALLOC_CTX *ctx, uint8_t const *packet, size_t packet_l p = packet + 4; end = packet + packet_len; + packet_ctx.tmp_ctx = talloc_init("tmp"); + /* * The caller MUST have called fr_dhcpv6_ok() first. If * he doesn't, all hell breaks loose.