You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function packet_handle_std_validate has a memory leak issue. When I set handle->valid= false after push experimenter match fields, this function will be called for the second time and memory leak happens.
It's because that the function doesn't free hash map so that it can't be called twice. The modified code looks like this:
The function packet_handle_std_validate has a memory leak issue. When I set handle->valid= false after push experimenter match fields, this function will be called for the second time and memory leak happens.
It's because that the function doesn't free hash map so that it can't be called twice. The modified code looks like this:
/* Free fields allocated previously */
HMAP_FOR_EACH_SAFE(iter, next, struct ofl_match_tlv, hmap_node, &m->match_fields) {
free(iter->value);
free(iter);
}
/* Resets all protocol fields to NULL */
protocols_reset(proto);
//hmap isn't freed,memory leak occurs when a packet has been validated twice
hmap_destroy(&m->match_fields);
ofl_structs_match_init(m);
handle->valid = true;
The text was updated successfully, but these errors were encountered: