diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-20 14:02:33 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-20 14:02:33 +0000 |
commit | c6bebca3c76985016970d87e75dd025a169790b0 (patch) | |
tree | 1d429d1c82e9775de8dcf746dd5b4720d1c1fce6 /stringbuf.c | |
parent | 33f061484d7456f0eb34f9ebab7a82e25ac26448 (diff) | |
download | rsyslog-c6bebca3c76985016970d87e75dd025a169790b0.tar.gz rsyslog-c6bebca3c76985016970d87e75dd025a169790b0.tar.bz2 rsyslog-c6bebca3c76985016970d87e75dd025a169790b0.zip |
changed rsCStrDestruct() to use the new interface conventions
Diffstat (limited to 'stringbuf.c')
-rwxr-xr-x | stringbuf.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/stringbuf.c b/stringbuf.c index 237355c0..3e222a5f 100755 --- a/stringbuf.c +++ b/stringbuf.c @@ -129,14 +129,19 @@ finalize_it: } -void rsCStrDestruct(rsCStrObj *pThis) +void rsCStrDestruct(rsCStrObj **ppThis) { + rsCStrObj *pThis = *ppThis; + /* rgerhards 2005-10-19: The free of pBuf was contained in conditional compilation. * The code was only compiled if STRINGBUF_TRIM_ALLOCSIZE was set to 1. I honestly * do not know why it was so, I think it was an artifact. Anyhow, I have changed this * now. Should there any issue occur, this comment hopefully will shed some light * on what happened. I re-verified, and this function has never before been called * by anyone. So changing it can have no impact for obvious reasons... + * + * rgerhards, 2008-02-20: I changed the interface to the new calling conventions, where + * the destructor receives a pointer to the object, so that it can set it to NULL. */ if(pThis->pBuf != NULL) { free(pThis->pBuf); @@ -147,6 +152,7 @@ void rsCStrDestruct(rsCStrObj *pThis) } RSFREEOBJ(pThis); + *ppThis = NULL; } |