Skip to content

Commit c129025

Browse files
If vp is not appended to tmp, it is not freed with tmp (as expected). Instead, explicitly free vp before going to fail.
Signed-off-by: ethan-thompson <ethan.thompson@networkradius.com>
1 parent 4f0c05f commit c129025

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/protocols/dhcpv6/base.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ ssize_t fr_dhcpv6_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *pa
614614
if (!vp) goto fail;
615615
if (fr_value_box_from_network(vp, &vp->data, vp->vp_type, NULL,
616616
&FR_DBUFF_TMP(packet + 1, 1), 1, true) < 0) {
617+
talloc_free(vp);
617618
goto fail;
618619
}
619620
fr_pair_append(&tmp, vp);
@@ -622,6 +623,7 @@ ssize_t fr_dhcpv6_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *pa
622623
if (!vp) goto fail;
623624
if (fr_value_box_from_network(vp, &vp->data, vp->vp_type, NULL,
624625
&FR_DBUFF_TMP(packet + 2, 16), 16, true) < 0) {
626+
talloc_free(vp);
625627
goto fail;
626628
}
627629
fr_pair_append(&tmp, vp);
@@ -630,6 +632,7 @@ ssize_t fr_dhcpv6_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *pa
630632
if (!vp) goto fail;
631633
if (fr_value_box_from_network(vp, &vp->data, vp->vp_type, NULL,
632634
&FR_DBUFF_TMP(packet + 2 + 16, 16), 16, true) < 0) {
635+
talloc_free(vp);
633636
goto fail;
634637
}
635638

0 commit comments

Comments
 (0)