mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-09 04:21:49 +08:00
sim: Be sure of calling freeargv() after successfully call buildargv().
Or there will be memory leak. 2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com> * mcore/interp.c (sim_do_command): Call freeargv() before return.
This commit is contained in:
parent
c9ba137e21
commit
cd71915c77
@ -1,3 +1,7 @@
|
||||
2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com>
|
||||
|
||||
* mcore/interp.c (sim_do_command): Call freeargv() before return.
|
||||
|
||||
2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com>
|
||||
|
||||
* common/sim-options.c (sim_args_command): Call freeargv() when
|
||||
|
@ -2143,6 +2143,7 @@ sim_do_command (sd, cmd)
|
||||
if ((simargv[1] == NULL) || (simargv[2] == NULL))
|
||||
{
|
||||
fprintf (stderr, "Error: missing argument to watch cmd.\n");
|
||||
freeargv (simargv);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2187,6 +2188,8 @@ sim_do_command (sd, cmd)
|
||||
fprintf (stderr,"Error: \"%s\" is not a valid M.CORE simulator command.\n",
|
||||
cmd);
|
||||
}
|
||||
|
||||
freeargv (simargv);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user