* gdbtk.c (gdbtk_readline): Fix memory leak.

This commit is contained in:
Tom Tromey
1996-11-19 16:38:48 +00:00
parent a5a6e3bd0a
commit bd45f82f41
2 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,8 @@
start-sanitize-gdbtk start-sanitize-gdbtk
Tue Nov 19 09:26:14 1996 Tom Tromey <tromey@cygnus.com>
* gdbtk.c (gdbtk_readline): Fix memory leak.
Mon Nov 18 23:43:05 1996 Tom Tromey <tromey@cygnus.com> Mon Nov 18 23:43:05 1996 Tom Tromey <tromey@cygnus.com>
Fixes for Tcl 7.6 / Tk 4.2: Fixes for Tcl 7.6 / Tk 4.2:

View File

@ -253,11 +253,14 @@ gdbtk_readline (prompt)
{ {
char *merge[2]; char *merge[2];
char *command; char *command;
int result;
merge[0] = "gdbtk_tcl_readline"; merge[0] = "gdbtk_tcl_readline";
merge[1] = prompt; merge[1] = prompt;
command = Tcl_Merge (2, merge); command = Tcl_Merge (2, merge);
if (Tcl_Eval (interp, command) == TCL_OK) result = Tcl_Eval (interp, command);
free (command);
if (result == TCL_OK)
{ {
return (strdup (interp -> result)); return (strdup (interp -> result));
} }