[ovs-dev] [PATCH ovn v5 1/9] ovn-controller: Store the local port bindings in the runtime data I-P state.
Dumitru Ceara
dceara at redhat.com
Mon May 11 14:35:40 UTC 2020
On 5/11/20 4:27 PM, Dumitru Ceara wrote:
>> +void
>> +local_bindings_destroy(struct shash *local_bindings)
>> +{
>> + struct shash_node *node, *next;
>> + SHASH_FOR_EACH_SAFE (node, next, local_bindings) {
>> + struct local_binding *lbinding = node->data;
>> + struct local_binding *c, *n;
>> + LIST_FOR_EACH_SAFE (c, n, node, &lbinding->children) {
>> + ovs_list_remove(&c->node);
>> + free(c->name);
>> + free(c);
>> + }
> Here we leak the lbinding->name memory.
>
>> + }
>> +
>> + shash_destroy(local_bindings);
> Here we leak the node->data (i.e., struct local_binding) memory. We
> should probably use shash_destroy_free_data().
>
I see now that the leak is fixed in patch #2 of the series but we might
want to move that to patch #1 to make sure it doesn't get applied
independently without the leak fix.
Thanks,
Dumitru
More information about the dev
mailing list