TMXR: Fix Coverity identified missing status check
This commit is contained in:
parent
567005a08d
commit
e353b910ea
1 changed files with 3 additions and 2 deletions
|
@ -5079,6 +5079,7 @@ t_stat tmxr_set_log (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
|
|||
{
|
||||
TMXR *mp = (TMXR *) desc;
|
||||
TMLN *lp;
|
||||
t_stat r;
|
||||
|
||||
if (cptr == NULL) /* no file name? */
|
||||
return SCPE_2FARG;
|
||||
|
@ -5091,8 +5092,8 @@ lp->txlogname = (char *) calloc (CBUFSIZE, sizeof (char)); /* alloc namebuf */
|
|||
if (lp->txlogname == NULL) /* can't? */
|
||||
return SCPE_MEM;
|
||||
strlcpy (lp->txlogname, cptr, CBUFSIZE); /* save file name */
|
||||
sim_open_logfile (cptr, TRUE, &lp->txlog, &lp->txlogref);/* open log */
|
||||
if (lp->txlog == NULL) { /* error? */
|
||||
r = sim_open_logfile (cptr, TRUE, &lp->txlog, &lp->txlogref);/* open log */
|
||||
if ((r != SCPE_OK) || (lp->txlog == NULL)) { /* error? */
|
||||
free (lp->txlogname); /* free buffer */
|
||||
return SCPE_OPENERR;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue