aboutsummaryrefslogtreecommitdiff
path: root/sim/arm
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
commit6c9e0292a363e1c678c73d69aef347ea7e1ed2c6 (patch)
tree05877f227782a3690096b140f00055d92b020f2c /sim/arm
parent6837a0a2a98f17adfd4b3723b6130d3ae4ae258e (diff)
downloadbinutils-6c9e0292a363e1c678c73d69aef347ea7e1ed2c6.zip
binutils-6c9e0292a363e1c678c73d69aef347ea7e1ed2c6.tar.gz
binutils-6c9e0292a363e1c678c73d69aef347ea7e1ed2c6.tar.bz2
* 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')
-rw-r--r--sim/arm/ChangeLog4
-rw-r--r--sim/arm/wrapper.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog
index 9262fa4..ce2a17e 100644
--- a/sim/arm/ChangeLog
+++ b/sim/arm/ChangeLog
@@ -1,3 +1,7 @@
+Wed Mar 22 15:24:21 2000 glen mccready <gkm@pobox.com>
+
+ * wrapper.c (sim_open,sim_close): Copy into myname, free myname.
+
2000-02-08 Nick Clifton <nickc@cygnus.com>
* wrapper.c: Fix compile time warning messages.
diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c
index 396c90d..8417f40 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