FLEX_ALLOC_MEM(entry, path, base->buf, base->len);
hashmap_entry_init(&entry->e, path_hash(entry->path));
- hashmap_add(&opt->current_file_dir_set, entry);
+ hashmap_add(&opt->current_file_dir_set, &entry->e);
strbuf_setlen(base, baselen);
return (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);
FLEX_ALLOC_MEM(entry, path, newpath.buf, newpath.len);
hashmap_entry_init(&entry->e, path_hash(entry->path));
- hashmap_add(&opt->current_file_dir_set, entry);
+ hashmap_add(&opt->current_file_dir_set, &entry->e);
return strbuf_detach(&newpath, NULL);
}