summaryrefslogtreecommitdiff
path: root/sim/arm/wrapper.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2000-03-23 23:28:43 +0000
committerFrank Ch. Eigler <fche@redhat.com>2000-03-23 23:28:43 +0000
commit894ae0c0c2dac719239528949d196bd11f25e562 (patch)
tree4b9ef2dd45b11483e38844913145ba88330b3a11 /sim/arm/wrapper.c
parent73890f6486e15b1a95bb2d0fcc32eeac974d3dbe (diff)
downloadgdb-894ae0c0c2dac719239528949d196bd11f25e562.tar.gz
* memory corruption fix
Wed Mar 22 15:24:21 2000 glen mccready <gkm@pobox.com> * wrapper.c (sim_open,sim_close): Copy into myname, free myname.
Diffstat (limited to 'sim/arm/wrapper.c')
-rw-r--r--sim/arm/wrapper.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c
index 396c90d8c4f..8417f40938e 100644
--- a/sim/arm/wrapper.c
+++ b/sim/arm/wrapper.c
@@ -352,7 +352,8 @@ sim_open (kind, ptr, abfd, argv)
char **argv;
{
sim_kind = kind;
- myname = argv[0];
+ if (myname) free (myname);
+ myname = xstrdup (argv[0]);
sim_callback = ptr;
/* Decide upon the endian-ness of the processor.
@@ -410,7 +411,8 @@ sim_close (sd, quitting)
SIM_DESC sd ATTRIBUTE_UNUSED;
int quitting ATTRIBUTE_UNUSED;
{
- /* nothing to do */
+ if (myname) free (myname);
+ myname = NULL;
}
SIM_RC