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> * microblaze/interp.c (sim_do_command): Call freeargv() before return.
This commit is contained in:
parent
cd71915c77
commit
907c4910c3
@ -1,3 +1,8 @@
|
||||
2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com>
|
||||
|
||||
* microblaze/interp.c (sim_do_command): Call freeargv() before
|
||||
return.
|
||||
|
||||
2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com>
|
||||
|
||||
* mcore/interp.c (sim_do_command): Call freeargv() before return.
|
||||
|
@ -1019,6 +1019,7 @@ sim_do_command (SIM_DESC sd, const char *cmd)
|
||||
if ((simargv[1] == NULL) || (simargv[2] == NULL))
|
||||
{
|
||||
fprintf (stderr, "Error: missing argument to watch cmd.\n");
|
||||
freeargv (simargv);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1062,6 +1063,8 @@ sim_do_command (SIM_DESC sd, const char *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