diff --git a/src/frontend/options.c b/src/frontend/options.c index a64cf5849..e8ebf6420 100644 --- a/src/frontend/options.c +++ b/src/frontend/options.c @@ -85,9 +85,8 @@ cp_enqvar(char *word) if (eq(word, "plots")) { struct variable *list = NULL; struct plot *pl; - for (pl = plot_list; pl; pl = pl->pl_next) { + for (pl = plot_list; pl; pl = pl->pl_next) list = var_alloc_string(NULL, copy(pl->pl_typename), list); - } return var_alloc_vlist(copy(word), list, NULL); } } diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 021b2915e..aa11cfc49 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -974,9 +974,8 @@ parmtovar(IFvalue *pv, IFparm *opt) case IF_REALVEC: { struct variable *list = NULL; int i; - for (i = pv->v.numValue; --i >= 0;) { + for (i = pv->v.numValue; --i >= 0;) list = var_alloc_real(NULL, pv->v.vec.rVec[i], list); - } return var_alloc_vlist(copy(opt->description), list, NULL); /* It is a linked list where the first node is a variable * pointing to the different values of the variables. diff --git a/src/frontend/variable.c b/src/frontend/variable.c index f1d7bccfe..96f5f4b54 100644 --- a/src/frontend/variable.c +++ b/src/frontend/variable.c @@ -339,11 +339,10 @@ cp_setparse(wordlist *wl) } copyval = ss = cp_unquote(wl->wl_word); td = ft_numparse(&ss, FALSE); - if (td) { + if (td) vv = var_alloc_real(NULL, *td, NULL); - } else { + else vv = var_alloc_string(NULL, copy(ss), NULL); - } tfree(copyval); /*DG: must free ss any way to avoid cp_unquote memory leak*/ if (listv) { lv->va_next = vv;