- A couple of small fixes for memory and initialization problems.
This is to make valgrind happy SKIPPED: psi/amorscan.c psi/el734hp.c psi/psi.c psi/tasscan.c
This commit is contained in:
41
conman.c
41
conman.c
@ -35,6 +35,10 @@
|
||||
Introduced SCPrintf to avoid many of these pBueffel.
|
||||
Markus Zolliker, Sept 2004.
|
||||
|
||||
Cleaned up conman data structure. Removed left over and unused
|
||||
fields.
|
||||
Mark Koennecke, December 2004
|
||||
|
||||
Copyright: see copyright.h
|
||||
-----------------------------------------------------------------------------*/
|
||||
#include "fortify.h"
|
||||
@ -167,7 +171,6 @@ extern pServer pServ;
|
||||
pRes->inUse = 0;
|
||||
pRes->iMacro = 0;
|
||||
pRes->iTelnet = 0;
|
||||
pRes->pSics = pSics;
|
||||
pRes->eInterrupt = eContinue;
|
||||
pRes->lMagic = CONMAGIC;
|
||||
pRes->iLogin = 0;
|
||||
@ -179,7 +182,7 @@ extern pServer pServ;
|
||||
}
|
||||
|
||||
/* install command */
|
||||
AddCommand(pRes->pSics, ConName(pRes->ident), ConSicsAction, NULL,pRes);
|
||||
AddCommand(pSics, ConName(pRes->ident), ConSicsAction, NULL,pRes);
|
||||
return pRes;
|
||||
|
||||
}
|
||||
@ -411,7 +414,7 @@ extern pServer pServ;
|
||||
fclose(pVictim->pFiles[i]);
|
||||
}
|
||||
|
||||
RemoveCommand(pVictim->pSics,ConName(pVictim->ident));
|
||||
RemoveCommand(pServ->pSics,ConName(pVictim->ident));
|
||||
|
||||
if(pVictim->pDes)
|
||||
{
|
||||
@ -428,14 +431,6 @@ extern pServer pServ;
|
||||
}
|
||||
LLDdelete(pVictim->iList);
|
||||
|
||||
/* remove standing data connections */
|
||||
if(pVictim->pDataSock)
|
||||
{
|
||||
NETClosePort(pVictim->pDataSock);
|
||||
free(pVictim->pDataSock);
|
||||
free(pVictim->pDataComp);
|
||||
}
|
||||
|
||||
/* remove command stack */
|
||||
if(pVictim->pStack)
|
||||
{
|
||||
@ -549,7 +544,9 @@ extern pServer pServ;
|
||||
l = vsnprintf(buf, sizeof buf, fmt, ap);
|
||||
va_end(ap);
|
||||
if (l >= sizeof buf) {
|
||||
/* we have probably a C99 conforming snprintf and need a larger buffer */
|
||||
/* we have probably a C99 conforming snprintf and
|
||||
need a larger buffer
|
||||
*/
|
||||
dyn = malloc(l+1);
|
||||
if (dyn != NULL) {
|
||||
va_start(ap, fmt);
|
||||
@ -662,7 +659,7 @@ static void writeToLogFiles(SConnection *self, char *buffer)
|
||||
/* put it into the interpreter if present */
|
||||
if(SCinMacro(self))
|
||||
{
|
||||
InterpWrite(self->pSics,buffer);
|
||||
InterpWrite(pServ->pSics,buffer);
|
||||
/* print it to client if error message */
|
||||
if((iOut== eError) || (iOut == eWarning) )
|
||||
{
|
||||
@ -742,7 +739,7 @@ static void writeToLogFiles(SConnection *self, char *buffer)
|
||||
/* put it into the interpreter if present */
|
||||
if(SCinMacro(self))
|
||||
{
|
||||
InterpWrite(self->pSics,buffer);
|
||||
InterpWrite(pServ->pSics,buffer);
|
||||
/* print it to client if error message */
|
||||
if((iOut== eError) || (iOut == eWarning) )
|
||||
{
|
||||
@ -793,7 +790,7 @@ static void writeToLogFiles(SConnection *self, char *buffer)
|
||||
/* put it into the interpreter if present */
|
||||
if(SCinMacro(self))
|
||||
{
|
||||
InterpWrite(self->pSics,buffer);
|
||||
InterpWrite(pServ->pSics,buffer);
|
||||
}
|
||||
else /* not in interpreter, normal logic */
|
||||
{
|
||||
@ -861,7 +858,7 @@ static void writeToLogFiles(SConnection *self, char *buffer)
|
||||
/* put it into the interpreter if present */
|
||||
if(SCinMacro(self))
|
||||
{
|
||||
InterpWrite(self->pSics,buffer);
|
||||
InterpWrite(pServ->pSics,buffer);
|
||||
}
|
||||
else /* not in interpreter, normal logic */
|
||||
{
|
||||
@ -1641,7 +1638,7 @@ static void writeToLogFiles(SConnection *self, char *buffer)
|
||||
|
||||
if(self->pAction)
|
||||
{
|
||||
InterpExecute(self->pSics,self->pCon,self->pAction);
|
||||
InterpExecute(pServ->pSics,self->pCon,self->pAction);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -1799,9 +1796,8 @@ static void writeToLogFiles(SConnection *self, char *buffer)
|
||||
}
|
||||
/* invoke command */
|
||||
CostaLock(self->pStack);
|
||||
SCInvoke(self,self->pSics,pPtr);
|
||||
SCInvoke(self,pServ->pSics,pPtr);
|
||||
CostaUnlock(self->pStack);
|
||||
/* SCWrite(self,"\b",eError); */
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1897,9 +1893,12 @@ int SCActive(SConnection *self)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if(GetExeOwner(pServ->pExecutor) == self)
|
||||
if(pServ->pExecutor != NULL)
|
||||
{
|
||||
return 1;
|
||||
if(GetExeOwner(pServ->pExecutor) == self)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user