summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-30 08:02:42 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-30 08:02:42 +0000
commit4984c1ba6c84a3ae91f9afd4da2ea718c98c97a7 (patch)
tree39972db40d9d0f642879a663aadcad996a510e50 /stream.c
parentef44f5c9ba319e2813e5ea23b2699b73b63cdcbb (diff)
downloadrsyslog-4984c1ba6c84a3ae91f9afd4da2ea718c98c97a7.tar.gz
rsyslog-4984c1ba6c84a3ae91f9afd4da2ea718c98c97a7.tar.xz
rsyslog-4984c1ba6c84a3ae91f9afd4da2ea718c98c97a7.zip
- renamed Msg object to usual all-lowercase object name (else we ran into
troubles with the framework, also it was somewhat ugly...) - fixed a memory leak in object destruction (was recently introduced by object naming, not present in any released version)
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/stream.c b/stream.c
index cb6d5e29..0f756d1c 100644
--- a/stream.c
+++ b/stream.c
@@ -324,15 +324,8 @@ finalize_it:
/* destructor for the strm object */
-rsRetVal strmDestruct(strm_t **ppThis)
-{
- strm_t *pThis;
- DEFiRet;
-
- assert(ppThis != NULL);
- pThis = *ppThis;
- ISOBJ_TYPE_assert(pThis, strm);
-
+BEGINobjDestruct(strm) /* be sure to specify the object type also in END and CODESTART macros! */
+CODESTARTobjDestruct(strm)
if(pThis->tOperationsMode == STREAMMODE_WRITE)
strmFlush(pThis);
@@ -342,13 +335,7 @@ rsRetVal strmDestruct(strm_t **ppThis)
if(pThis->pszDir != NULL)
free(pThis->pszDir);
-
- /* and finally delete the strm objet itself */
- free(pThis);
- *ppThis = NULL;
-
- RETiRet;
-}
+ENDobjDestruct(strm)
/* check if we need to open a new file (in output mode only).