com_alter_common(), cleanup storage more thoroughly (on error)

This commit is contained in:
rlar 2012-10-01 21:09:26 +02:00
parent 124f0f4727
commit 98b38556aa
1 changed files with 4 additions and 2 deletions

View File

@ -1366,11 +1366,11 @@ com_alter_common(wordlist *wl, int do_model)
dv = ft_evaluate(names);
if (!dv)
return;
goto done;
if (dv->v_length < 1) {
fprintf(cp_err, "Error: cannot evaluate new parameter value.\n");
return;
goto done;
}
/* If we want alter the geometry of a MOS device
@ -1383,6 +1383,8 @@ com_alter_common(wordlist *wl, int do_model)
/* va: garbage collection for dv, if pnode names is no simple value */
if (names->pn_value == NULL && dv != NULL)
vec_free(dv);
done:
free_pnode(names); /* free also dv, if pnode names is simple value */
}