Skip to content

Commit

Permalink
Merge pull request #9289 from donaldsharp/fuzz_ospfd
Browse files Browse the repository at this point in the history
ospfd: Do not leak memory when fuzzing
  • Loading branch information
qlyoung authored Aug 10, 2021
2 parents 96959a8 + b0691fd commit 4851ffb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ospfd/ospf_lsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -3502,6 +3502,9 @@ void ospf_schedule_lsa_flood_area(struct ospf_area *area, struct ospf_lsa *lsa)
data->lsa = ospf_lsa_lock(lsa); /* Message / Flood area */

thread_add_event(master, ospf_lsa_action, data, 0, NULL);
#ifdef FUZZING
XFREE(MTYPE_OSPF_MESSAGE, data);
#endif
}

void ospf_schedule_lsa_flush_area(struct ospf_area *area, struct ospf_lsa *lsa)
Expand All @@ -3514,6 +3517,9 @@ void ospf_schedule_lsa_flush_area(struct ospf_area *area, struct ospf_lsa *lsa)
data->lsa = ospf_lsa_lock(lsa); /* Message / Flush area */

thread_add_event(master, ospf_lsa_action, data, 0, NULL);
#ifdef FUZZING
XFREE(MTYPE_OSPF_MESSAGE, data);
#endif
}


Expand Down

0 comments on commit 4851ffb

Please sign in to comment.