CodeQL MemoryMayNotBeFreed.ql rtrCmd.c CmdRoute()

temporary channel created to run command is not cleaned up
This commit is contained in:
Darryl L. Miles 2025-02-13 08:32:00 +00:00 committed by Tim Edwards
parent 822a95ab35
commit cb9333804a
1 changed files with 6 additions and 2 deletions

View File

@ -575,8 +575,12 @@ CmdRoute(w, cmd)
if(cmd->tx_argc!=3) if(cmd->tx_argc!=3)
goto wrongNumArgs; goto wrongNumArgs;
if((ch = GCRRouteFromFile(cmd->tx_argv[2])) == (GCRChannel *) NULL) if((ch = GCRRouteFromFile(cmd->tx_argv[2])) == (GCRChannel *) NULL)
TxError("Bad channel from file %s\n", cmd->tx_argv[2]); TxError("Bad channel from file %s\n", cmd->tx_argv[2]);
else RtrPaintBack(ch, EditCellUse->cu_def); else
{
RtrPaintBack(ch, EditCellUse->cu_def);
GCRFreeChannel(ch);
}
break; break;
case ROUTERSHOWRES: case ROUTERSHOWRES:
GcrShowResult= !GcrShowResult; GcrShowResult= !GcrShowResult;