summaryrefslogtreecommitdiff
path: root/src/htab.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/htab.c')
-rw-r--r--src/htab.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/htab.c b/src/htab.c
index 066d761..11d5a98 100644
--- a/src/htab.c
+++ b/src/htab.c
@@ -71,13 +71,12 @@ int htab_enter(struct htab *htab, const char *key, void *data)
return -errno;
}
- e.data = data;
ret = hsearch_r(e, ENTER, &ep, htab->table);
if (ret == 0) {
print_err("%s", strerror(errno));
return -errno;
}
- ep->data = NULL;
+ ep->data = data;
if (ep->key != e.key) {
free(e.key);