From 2aca3c2d33dd1a19daf44168e90a5f64bd4095b0 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 May 2009 17:35:21 +0200 Subject: made imdiag *just* compile & some cleanup imdiag was never finished (not even really begun), but now I need it. I made the few things that are available compile, but more serious work is required. --- tcpsrv.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'tcpsrv.c') diff --git a/tcpsrv.c b/tcpsrv.c index b9434398..7af45d3c 100644 --- a/tcpsrv.c +++ b/tcpsrv.c @@ -17,7 +17,7 @@ * * File begun on 2007-12-21 by RGerhards (extracted from syslogd.c) * - * Copyright 2007, 2008 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007, 2008, 2009 Rainer Gerhards and Adiscon GmbH. * * This file is part of rsyslog. * @@ -219,8 +219,7 @@ static void deinit_tcp_listener(tcpsrv_t *pThis) pThis->pSessions = NULL; /* just to make sure... */ } - if(pThis->TCPLstnPort != NULL) - free(pThis->TCPLstnPort); + free(pThis->TCPLstnPort); /* finally close our listen streams */ for(i = 0 ; i < pThis->iLstnMax ; ++i) { @@ -557,12 +556,9 @@ CODESTARTobjDestruct(tcpsrv) if(pThis->pNS != NULL) netstrms.Destruct(&pThis->pNS); - if(pThis->pszDrvrAuthMode != NULL) - free(pThis->pszDrvrAuthMode); - if(pThis->ppLstn != NULL) - free(pThis->ppLstn); - if(pThis->pszInputName != NULL) - free(pThis->pszInputName); + free(pThis->pszDrvrAuthMode); + free(pThis->ppLstn); + free(pThis->pszInputName); ENDobjDestruct(tcpsrv) @@ -683,8 +679,7 @@ SetInputName(tcpsrv_t *pThis, uchar *name) pszName = NULL; else CHKmalloc(pszName = (uchar*)strdup((char*)name)); - if(pThis->pszInputName != NULL) - free(pThis->pszInputName); + free(pThis->pszInputName); pThis->pszInputName = pszName; finalize_it: RETiRet; -- cgit