SCP: Fix potential leak in error path exit (Coverity)
This commit is contained in:
parent
e994a4aeda
commit
7984074f5f
1 changed files with 4 additions and 2 deletions
6
scp.c
6
scp.c
|
@ -3501,8 +3501,10 @@ if (flag >= 0) { /* Only bump nesting fro
|
||||||
}
|
}
|
||||||
|
|
||||||
sim_debug (SIM_DBG_DO, sim_dflt_dev, "do_cmd_label(%d, flag=%d, '%s', '%s')\n", sim_do_depth, flag, fcptr, label ? label : "");
|
sim_debug (SIM_DBG_DO, sim_dflt_dev, "do_cmd_label(%d, flag=%d, '%s', '%s')\n", sim_do_depth, flag, fcptr, label ? label : "");
|
||||||
if (NULL == (c = sim_filepath_parts (cbuf, "f")))
|
if (NULL == (c = sim_filepath_parts (cbuf, "f"))) {
|
||||||
return SCPE_MEM;
|
stat = SCPE_MEM;
|
||||||
|
goto Cleanup_Return;
|
||||||
|
}
|
||||||
strlcpy( sim_do_filename[sim_do_depth], c,
|
strlcpy( sim_do_filename[sim_do_depth], c,
|
||||||
sizeof (sim_do_filename[sim_do_depth])); /* stash away full path of do file name for possible use by 'call' command */
|
sizeof (sim_do_filename[sim_do_depth])); /* stash away full path of do file name for possible use by 'call' command */
|
||||||
free (c);
|
free (c);
|
||||||
|
|
Loading…
Add table
Reference in a new issue