fix 3 potential (small) memory leaks
This commit is contained in:
parent
9f99a31fac
commit
fa25edabec
|
|
@ -2836,6 +2836,6 @@ int tclvareval(const char *script, ...)
|
|||
}
|
||||
return_code = Tcl_EvalEx(interp, str, size, TCL_EVAL_GLOBAL);
|
||||
va_end(args);
|
||||
my_free(1381, &p);
|
||||
my_free(1381, &str);
|
||||
return return_code;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1632,7 +1632,7 @@ int print_spice_element(FILE *fd, int inst)
|
|||
tok_val_len = strlen(value);
|
||||
|
||||
if(!strcmp(token, "@spiceprefix")) {
|
||||
spiceprefixtag = my_malloc(301, tok_val_len+22);
|
||||
my_realloc(301, &spiceprefixtag, tok_val_len+22);
|
||||
my_snprintf(spiceprefixtag, tok_val_len+22, "**** spice_prefix %s\n", value);
|
||||
value = spiceprefixtag;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1915,7 +1915,13 @@ int Tcl_AppInit(Tcl_Interp *inter)
|
|||
|
||||
/* source tcl file given on command line with --script */
|
||||
if(tcl_script[0]) {
|
||||
tclvareval("update; source {", tcl_script, "}", NULL);
|
||||
char str[PATH_MAX + 40];
|
||||
/* can not use tclvareval() here because if script contains 'exit'
|
||||
* program terminates before tclvareval() has a chance to cleanup
|
||||
* its dynamically allocated string
|
||||
*/
|
||||
my_snprintf(str, S(str), "update; source {%s}", tcl_script);
|
||||
Tcl_EvalEx(interp, str, -1, TCL_EVAL_GLOBAL);
|
||||
}
|
||||
|
||||
if(quit) {
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ comment="
|
|||
"
|
||||
tclcommand="
|
||||
set count 0
|
||||
set duration 1000
|
||||
set duration 300
|
||||
xschem select instance p8 ;# CLEAR_
|
||||
xschem select instance p9 ;# CLK
|
||||
xschem logic_set 0 ;# reset pulse (active low)
|
||||
|
|
|
|||
Loading…
Reference in New Issue