Skip to content

Commit

Permalink
isisd: Ensure rcap is freed in error case
Browse files Browse the repository at this point in the history
unpack_tlv_router_cap allocates memory that in the error
case is not being freed.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Jul 22, 2022
1 parent d2aeac3 commit 49efc80
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions isisd/isis_tlvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3580,9 +3580,9 @@ static int pack_tlv_router_cap(const struct isis_router_cap *router_cap,
}

static int unpack_tlv_router_cap(enum isis_tlv_context context,
uint8_t tlv_type, uint8_t tlv_len,
struct stream *s, struct sbuf *log,
void *dest, int indent)
uint8_t tlv_type, uint8_t tlv_len,
struct stream *s, struct sbuf *log, void *dest,
int indent)
{
struct isis_tlvs *tlvs = dest;
struct isis_router_cap *rcap;
Expand Down Expand Up @@ -3627,7 +3627,7 @@ static int unpack_tlv_router_cap(enum isis_tlv_context context,
log, indent,
"WARNING: Router Capability subTLV length too large compared to expected size\n");
stream_forward_getp(s, STREAM_READABLE(s));

XFREE(MTYPE_ISIS_TLV, rcap);
return 0;
}

Expand Down

0 comments on commit 49efc80

Please sign in to comment.