+2020-09-17 Tom Tromey <tom@tromey.com>
+
+ * breakpoint.c (ambiguous_names_p): Use htab_up.
+
2020-09-17 Tom Tromey <tom@tromey.com>
* auto-load.c (struct auto_load_pspace_info)
ambiguous_names_p (struct bp_location *loc)
{
struct bp_location *l;
- htab_t htab = htab_create_alloc (13, htab_hash_string, streq_hash, NULL,
- xcalloc, xfree);
+ htab_up htab (htab_create_alloc (13, htab_hash_string, streq_hash, NULL,
+ xcalloc, xfree));
for (l = loc; l != NULL; l = l->next)
{
if (name == NULL)
continue;
- slot = (const char **) htab_find_slot (htab, (const void *) name,
+ slot = (const char **) htab_find_slot (htab.get (), (const void *) name,
INSERT);
/* NOTE: We can assume slot != NULL here because xcalloc never
returns NULL. */
if (*slot != NULL)
- {
- htab_delete (htab);
- return 1;
- }
+ return 1;
*slot = name;
}
- htab_delete (htab);
return 0;
}