aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-cmd-disas.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-03-09 20:31:50 +0000
committerMichael Snyder <msnyder@vmware.com>2011-03-09 20:31:50 +0000
commit85c9d6a63284a825f5c174f80d272b4aa19bc828 (patch)
treeb83412bafa93a3077db6ca323238e9aad08dd9c4 /gdb/mi/mi-cmd-disas.c
parent5dbdd470c7118c724c686115a6803aa5b8d87278 (diff)
downloadgdb-85c9d6a63284a825f5c174f80d272b4aa19bc828.zip
gdb-85c9d6a63284a825f5c174f80d272b4aa19bc828.tar.gz
gdb-85c9d6a63284a825f5c174f80d272b4aa19bc828.tar.bz2
2011-03-09 Michael Snyder <msnyder@vmware.com>
* mi-cmd-disas.c (mi_cmd_disassemble): Fix memory leak.
Diffstat (limited to 'gdb/mi/mi-cmd-disas.c')
-rw-r--r--gdb/mi/mi-cmd-disas.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c
index bfe1769..28e84f6 100644
--- a/gdb/mi/mi-cmd-disas.c
+++ b/gdb/mi/mi-cmd-disas.c
@@ -73,6 +73,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
int how_many = -1;
CORE_ADDR low = 0;
CORE_ADDR high = 0;
+ struct cleanup *cleanups = make_cleanup (null_cleanup, NULL);
/* Options processing stuff. */
int optind = 0;
@@ -103,6 +104,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
case FILE_OPT:
file_string = xstrdup (optarg);
file_seen = 1;
+ make_cleanup (xfree, file_string);
break;
case LINE_OPT:
line_num = atoi (optarg);
@@ -169,4 +171,6 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
file_string,
disasm_flags,
how_many, low, high);
+
+ do_cleanups (cleanups);
}