Skip to content

Commit

Permalink
Merge pull request #1409 from aikuchin/fix_leak_in_add_to_portlid_hash
Browse files Browse the repository at this point in the history
ibnetdisc: Fix leak in add_to_portlid_hash
  • Loading branch information
rleon committed Dec 17, 2023
2 parents 69cc13f + 5814d78 commit 482b7fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libibnetdisc/ibnetdisc.c
Expand Up @@ -704,8 +704,11 @@ void add_to_portlid_hash(ibnd_port_t * port, f_internal_t *f_int)
item = malloc(sizeof(*item));
if (item) {
item->port = port;
cl_qmap_insert(&f_int->lid2guid, lid,
&item->cl_map);
if (cl_qmap_insert(&f_int->lid2guid, lid,
&item->cl_map) != &item->cl_map) {
/* Port is already in map, release item */
free(item);
}
}
}
}
Expand Down

0 comments on commit 482b7fb

Please sign in to comment.