From: Chen Gang Date: Fri, 30 Jan 2015 21:58:51 +0000 (+0800) Subject: sim: Call freeargv() when failure occurs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c9ba137e2157b989b878198f94c7d5f01a937500;p=binutils-gdb.git sim: Call freeargv() when failure occurs After successfully call buildargv(), the code need to be sure of calling freeargv() in any cases. 2015-02-02 Chen Gang * common/sim-options.c (sim_args_command): Call freeargv() when failure occurs. --- diff --git a/sim/ChangeLog b/sim/ChangeLog index 03c244b3683..9ddee6482df 100644 --- a/sim/ChangeLog +++ b/sim/ChangeLog @@ -1,3 +1,8 @@ +2015-02-02 Chen Gang + + * common/sim-options.c (sim_args_command): Call freeargv() when + failure occurs. + 2014-07-01 Chen Gang * sim/microblaze/interp.c: Use long int format instead of int diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index c49220e6de6..814edcf5f22 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -993,7 +993,10 @@ sim_args_command (SIM_DESC sd, const char *cmd) sim_cpu *cpu; if (argv [0] == NULL) - return SIM_RC_OK; /* FIXME - perhaps help would be better */ + { + freeargv (argv); + return SIM_RC_OK; /* FIXME - perhaps help would be better */ + } /* First check for a cpu selector. */ {