Skip to content

Commit 49efc80

Browse files
committed
isisd: Ensure rcap is freed in error case
unpack_tlv_router_cap allocates memory that in the error case is not being freed. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
1 parent d2aeac3 commit 49efc80

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

isisd/isis_tlvs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3580,9 +3580,9 @@ static int pack_tlv_router_cap(const struct isis_router_cap *router_cap,
35803580
}
35813581

35823582
static int unpack_tlv_router_cap(enum isis_tlv_context context,
3583-
uint8_t tlv_type, uint8_t tlv_len,
3584-
struct stream *s, struct sbuf *log,
3585-
void *dest, int indent)
3583+
uint8_t tlv_type, uint8_t tlv_len,
3584+
struct stream *s, struct sbuf *log, void *dest,
3585+
int indent)
35863586
{
35873587
struct isis_tlvs *tlvs = dest;
35883588
struct isis_router_cap *rcap;
@@ -3627,7 +3627,7 @@ static int unpack_tlv_router_cap(enum isis_tlv_context context,
36273627
log, indent,
36283628
"WARNING: Router Capability subTLV length too large compared to expected size\n");
36293629
stream_forward_getp(s, STREAM_READABLE(s));
3630-
3630+
XFREE(MTYPE_ISIS_TLV, rcap);
36313631
return 0;
36323632
}
36333633

0 commit comments

Comments
 (0)