- Introducted Arg2Tcl as a replacement for some calls to Arg2Text

- Fixed a memory leak
This commit is contained in:
zolliker
2006-04-11 07:26:55 +00:00
parent e25fb68080
commit da3dfd9d76
11 changed files with 184 additions and 92 deletions

View File

@ -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;