Fix an apparent memory leak

This commit is contained in:
Přemysl Eric Janouch 2018-10-09 08:55:03 +02:00
parent 7c9fb564af
commit 55a1076367
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 2 additions and 3 deletions

5
ell.c
View File

@ -734,9 +734,8 @@ ell_set (struct ell *ell, const char *name, struct ell_v *v) {
for (struct ell_v *scope = ell->scopes; scope; scope = scope->next) { for (struct ell_v *scope = ell->scopes; scope; scope = scope->next) {
if ((place = ell_scope_find (&scope->head, name))) { if ((place = ell_scope_find (&scope->head, name))) {
ell_free_seq ((*place)->head->next); ell_free_seq ((*place)->head->next);
(*place)->head->next = NULL; (*place)->head->next = v;
return !v return true;
|| ell_check (ell, ((*place)->head->next = ell_clone (v)));
} }
} }