- Introducted Arg2Tcl as a replacement for some calls to Arg2Text
- Fixed a memory leak
This commit is contained in:
10
script.c
10
script.c
@@ -411,6 +411,7 @@
|
||||
char pBueffel[256];
|
||||
Tcl_Interp *pTcl = NULL;
|
||||
int iRet;
|
||||
char *cmd;
|
||||
|
||||
assert(pCon);
|
||||
assert(pSics);
|
||||
@@ -425,8 +426,13 @@
|
||||
pTcl = InterpGetTcl(pSics);
|
||||
assert(pTcl);
|
||||
|
||||
Arg2Text(argc-1,&argv[1],pBueffel,255);
|
||||
iRet = Tcl_Eval(pTcl,pBueffel);
|
||||
cmd = Arg2Tcl(argc-1,&argv[1],pBueffel,sizeof pBueffel);
|
||||
if (!cmd) {
|
||||
SCWrite(pCon,"ERROR: no more memory",eError);
|
||||
return 0;
|
||||
}
|
||||
iRet = Tcl_Eval(pTcl,cmd);
|
||||
if (cmd != pBueffel) free(cmd);
|
||||
if(strlen(pTcl->result) > 1)
|
||||
{
|
||||
SCWrite(pCon,pTcl->result,eValue);
|
||||
|
||||
Reference in New Issue
Block a user