[PATCH 1/4] libibery/hashtab: add new functions
Martin Liška
mliska@suse.cz
Tue Aug 18 12:17:05 GMT 2020
On 8/17/20 4:33 PM, Tom Tromey wrote:
> Martin> +void
> Martin> +htab_insert (htab_t htab, PTR element)
> Martin> +{
> Martin> + void **slot = htab_find_slot (htab, element, INSERT);
> Martin> + *slot = element;
>
> If there is an old value, and if htab->del_f is non-NULL, then this
> should call del_f function. Otherwise, I think this leaks memory.
Good point! Thanks.
Martin
>
> Tom
>
More information about the Binutils
mailing list