summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/variable.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/variable.c b/src/variable.c
index 333daeb..8e75ea2 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -163,24 +163,27 @@ symtab_remove(struct symtab *st, const char *name)
unsigned int pos, i, j, r;
struct variable *entry;
pos = hash_string(name, hash_size[st->hash_num]);
for (i = pos; (entry = st->tab[i]);) {
if (strcmp(entry->name, name) == 0)
break;
if (++i >= hash_size[st->hash_num])
i = 0;
if (i == pos)
return ENOENT;
}
+
+ if (!entry)
+ return ENOENT;
var_free(entry);
for (;;) {
st->tab[i] = NULL;
j = i;
do {
if (++i >= hash_size[st->hash_num])
i = 0;
if (!st->tab[i])
return 0;

Return to:

Send suggestions and report system problems to the System administrator.