Skip to content

Commit

Permalink
fix: Add missing free in dht_get_nodes_response event.
Browse files Browse the repository at this point in the history
This was added everywhere except here.
  • Loading branch information
iphydf committed Nov 9, 2024
1 parent 55752a2 commit 3acef4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion toxcore/events/dht_get_nodes_response.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ static Tox_Event_Dht_Get_Nodes_Response *tox_events_add_dht_get_nodes_response(T
event.type = TOX_EVENT_DHT_GET_NODES_RESPONSE;
event.data.dht_get_nodes_response = dht_get_nodes_response;

tox_events_add(events, &event);
if (!tox_events_add(events, &event)) {
tox_event_dht_get_nodes_response_free(dht_get_nodes_response, mem);
return nullptr;
}
return dht_get_nodes_response;
}

Expand Down

0 comments on commit 3acef4b

Please sign in to comment.