summaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 7da4ac4a325..fdc5c1bb5f6 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -53,7 +53,9 @@ int display_space;
processes UI events asynchronously. */
int event_loop_p = 1;
-/* Has an interpreter been specified and if so, which. */
+/* Has an interpreter been specified and if so, which.
+ This will be used as a set command variable, so it should
+ always be malloc'ed - since do_setshow_command will free it. */
char *interpreter_p;
/* Whether this is the command line version or not */
@@ -386,7 +388,7 @@ extern int gdbtk_test (char *);
}
#endif /* GDBTK */
case 'i':
- interpreter_p = optarg;
+ interpreter_p = xstrdup (optarg);
break;
case 'd':
dirarg[ndir++] = optarg;