fix small memory leak

This commit is contained in:
stefan schippers 2023-11-10 15:43:36 +01:00
parent 3f85766c10
commit 1991b409e0
2 changed files with 2 additions and 2 deletions

View File

@ -1798,7 +1798,6 @@ void get_additional_symbols(int what)
copy_symbol(&xctx->sym[j], xctx->inst[i].ptr + xctx->sym);
xctx->sym[j].base_name = (xctx->inst[i].ptr + xctx->sym)->name;
my_strdup(_ALLOC_ID_, &xctx->sym[j].name, sym);
my_free(_ALLOC_ID_, &sym);
if(spice_sym_def)
my_strdup(_ALLOC_ID_, &xctx->sym[j].prop_ptr,
subst_token(xctx->sym[j].prop_ptr, "spice_sym_def", spice_sym_def));
@ -1812,6 +1811,7 @@ void get_additional_symbols(int what)
} else {
j = found->value;
}
my_free(_ALLOC_ID_, &sym);
}
my_free(_ALLOC_ID_, &sch);
my_free(_ALLOC_ID_, &spice_sym_def);

View File

@ -4655,7 +4655,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
hash_objects();
dbg(0, "n_hash_objects=%d\n", xctx->n_hash_objects);
for(init_object_iterator(&ctx, 1000., -1000., 2000., -400.); (objectptr = object_iterator_next(&ctx)) ;) {
for(init_object_iterator(&ctx, -420., -970., 1300., -250.); (objectptr = object_iterator_next(&ctx)) ;) {
type = objectptr->type;
n = objectptr->n;
c = objectptr->c;