summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-28 08:09:21 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-28 08:09:21 +0200
commit76e4eb29d4343d11cb2e4b354f7d7d14df707b7a (patch)
treeb28b7ea4aa35d399c30feecda7a4d41a25e8fb29
parent75cf92117c118f9aca37b39f44ad1e1e759f78bf (diff)
downloadrsyslog-76e4eb29d4343d11cb2e4b354f7d7d14df707b7a.tar.gz
rsyslog-76e4eb29d4343d11cb2e4b354f7d7d14df707b7a.tar.xz
rsyslog-76e4eb29d4343d11cb2e4b354f7d7d14df707b7a.zip
fixed memory leaks
-rw-r--r--runtime/nsd_gtls.c7
-rw-r--r--runtime/nsdsel_ptcp.c2
-rw-r--r--tcpsrv.c6
3 files changed, 6 insertions, 9 deletions
diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c
index f3622f36..d59043f2 100644
--- a/runtime/nsd_gtls.c
+++ b/runtime/nsd_gtls.c
@@ -128,9 +128,9 @@ CODESTARTobjDestruct(nsd_gtls)
gtlsEndSess(pThis);
}
-RUNLOG_VAR("%p", pThis->pTcp);
- if(pThis->pTcp != NULL)
+ if(pThis->pTcp != NULL) {
nsd_ptcp.Destruct(&pThis->pTcp);
+ }
ENDobjDestruct(nsd_gtls)
@@ -231,7 +231,9 @@ AcceptConnReq(nsd_t *pNsd, nsd_t **ppNew)
nsd_gtls_t *pThis = (nsd_gtls_t*) pNsd;
ISOBJ_TYPE_assert((pThis), nsd_gtls);
+ // TODO: method to construct without pTcp
CHKiRet(nsd_gtlsConstruct(&pNew));
+ CHKiRet(nsd_ptcp.Destruct(&pNew->pTcp));
CHKiRet(nsd_ptcp.AcceptConnReq(pThis->pTcp, &pNew->pTcp));
*ppNew = (nsd_t*) pNew;
@@ -262,7 +264,6 @@ Rcv(nsd_t *pNsd, uchar *pBuf, ssize_t *pLenBuf)
ISOBJ_TYPE_assert(pThis, nsd_gtls);
if(pThis->iMode == 0) {
-RUNLOG;
CHKiRet(nsd_ptcp.Rcv(pThis->pTcp, pBuf, pLenBuf));
FINALIZE;
}
diff --git a/runtime/nsdsel_ptcp.c b/runtime/nsdsel_ptcp.c
index 22c000b9..b439063a 100644
--- a/runtime/nsdsel_ptcp.c
+++ b/runtime/nsdsel_ptcp.c
@@ -71,8 +71,6 @@ Add(nsdsel_t *pNsdsel, nsd_t *pNsd, nsdsel_waitOp_t waitOp)
ISOBJ_TYPE_assert(pSock, nsd_ptcp);
ISOBJ_TYPE_assert(pThis, nsdsel_ptcp);
-RUNLOG_VAR("%d", pSock->sock);
-RUNLOG_VAR("%p", &pThis->readfds);
switch(waitOp) {
case NSDSEL_RD:
FD_SET(pSock->sock, &pThis->readfds);
diff --git a/tcpsrv.c b/tcpsrv.c
index 638d7019..069c83c0 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -333,10 +333,8 @@ SessAccept(tcpsrv_t *pThis, tcps_sess_t **ppSess, netstrm_t *pStrm)
CHKiRet(netstrm.GetRemoteHName(pStrm, &fromHostFQDN));
/* TODO: check if we need to strip the domain name here -- rgerhards, 2008-04-24 */
- /* Here we check if a host is permitted to send us
- * syslog messages. If it isn't, we do not further
- * process the message but log a warning (if we are
- * configured to do this).
+ /* Here we check if a host is permitted to send us messages. If it isn't, we do not further
+ * process the message but log a warning (if we are configured to do this).
* rgerhards, 2005-09-26
*/
if(!pThis->pIsPermittedHost((struct sockaddr*) &addr, (char*) fromHostFQDN, pThis->pUsr, pSess->pUsr)) {