- Introducted Arg2Tcl as a replacement for some calls to Arg2Text
- Fixed a memory leak
This commit is contained in:
10
sicscron.c
10
sicscron.c
@ -83,8 +83,8 @@
|
||||
{
|
||||
pCron pNew = NULL;
|
||||
int iVal, iRet;
|
||||
char pBueffel[512];
|
||||
|
||||
char *cmd;
|
||||
|
||||
/* only managers may do this */
|
||||
if(!SCMatchRights(pCon,usMugger))
|
||||
{
|
||||
@ -108,11 +108,11 @@
|
||||
}
|
||||
|
||||
/* concatenate the rest to the command */
|
||||
Arg2Text(argc-2,&argv[2],pBueffel,511);
|
||||
cmd = Arg2Tcl(argc-2,&argv[2],NULL,0);
|
||||
|
||||
/* create data structure and install task */
|
||||
pNew = (pCron)malloc(sizeof(Cron));
|
||||
if(!pNew)
|
||||
if(!pNew || !cmd)
|
||||
{
|
||||
SCWrite(pCon,"ERROR: out of memory in sicscron",eError);
|
||||
return 0;
|
||||
@ -124,7 +124,7 @@
|
||||
return 0;
|
||||
}
|
||||
pNew->iIntervall = iVal;
|
||||
pNew->pCommand = strdup(pBueffel);
|
||||
pNew->pCommand = cmd;
|
||||
pNew->tNext = 0;
|
||||
pNew->iEnd = 1;
|
||||
|
||||
|
Reference in New Issue
Block a user