On 10:00 Sun 21 Oct , Yevgeny Kliteynik wrote: > >> + if (!st_lookup(p_qos_policy->p_node_hash, > >> + (st_data_t)p_node->print_desc, > >> + (st_data_t*)&p_node)) > >> + st_insert(p_qos_policy->p_node_hash, > >> + (st_data_t)p_node->print_desc, > >> + (st_data_t)p_node); > > st_lookup() is not needed? st_insert() replace entry if it exists. In > > case of identical node_desc last will appear. > > Whether the first or the last appearance will remain in the hash, > it's bad either way, but if the value in the hash will be replaced, > it will create memory leak, since the previous value won't be freed.
Hmm, right, st_* does internal allocation - I missed this. Sasha _______________________________________________ general mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
