diff options
author | Michael Biebl <biebl@debian.org> | 2014-08-18 17:48:20 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2014-08-18 17:48:20 +0200 |
commit | 1dfcd909d90f6fad4a612b6fd998d7473a9da399 (patch) | |
tree | b9fb75cfd347088f1850b48e298c5db564304ece /runtime/stringbuf.c | |
parent | daeb0d03d4a65fa118ad25b34958fb9cacbbd6f4 (diff) | |
download | rsyslog-1dfcd909d90f6fad4a612b6fd998d7473a9da399.tar.gz |
Imported Upstream version 8.4.0upstream/8.4.0
Diffstat (limited to 'runtime/stringbuf.c')
-rw-r--r-- | runtime/stringbuf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/stringbuf.c b/runtime/stringbuf.c index 18af7af..430e3b8 100644 --- a/runtime/stringbuf.c +++ b/runtime/stringbuf.c @@ -457,11 +457,14 @@ uchar* rsCStrGetSzStr(cstr_t *pThis) * PLEASE NOTE: the caller must free the memory returned in ppSz in any case * (except, of course, if it is NULL). */ -rsRetVal cstrConvSzStrAndDestruct(cstr_t *pThis, uchar **ppSz, int bRetNULL) +rsRetVal cstrConvSzStrAndDestruct(cstr_t **ppThis, uchar **ppSz, int bRetNULL) { DEFiRet; uchar* pRetBuf; + cstr_t *pThis; + assert(ppThis != NULL); + pThis = *ppThis; rsCHECKVALIDOBJECT(pThis, OIDrsCStr); assert(ppSz != NULL); assert(bRetNULL == 0 || bRetNULL == 1); @@ -475,7 +478,7 @@ rsRetVal cstrConvSzStrAndDestruct(cstr_t *pThis, uchar **ppSz, int bRetNULL) } } else pRetBuf = pThis->pBuf; - + *ppSz = pRetBuf; finalize_it: @@ -484,6 +487,8 @@ finalize_it: * also free the sz String buffer, which we pass on to the user. */ RSFREEOBJ(pThis); + *ppThis = NULL; + RETiRet; } |