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/prop.c | |
parent | daeb0d03d4a65fa118ad25b34958fb9cacbbd6f4 (diff) | |
download | rsyslog-1dfcd909d90f6fad4a612b6fd998d7473a9da399.tar.gz |
Imported Upstream version 8.4.0upstream/8.4.0
Diffstat (limited to 'runtime/prop.c')
-rw-r--r-- | runtime/prop.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/runtime/prop.c b/runtime/prop.c index fa067bd..0686b40 100644 --- a/runtime/prop.c +++ b/runtime/prop.c @@ -139,15 +139,24 @@ static rsRetVal AddRef(prop_t *pThis) /* this is a "do it all in one shot" function that creates a new property, * assigns the provided string to it and finalizes the property. Among the - * convenience, it is alos (very, very) slightly faster. + * convenience, it is also (very, very) slightly faster. * rgerhards, 2009-07-01 */ static rsRetVal CreateStringProp(prop_t **ppThis, const uchar* psz, const int len) { + prop_t *pThis = NULL; DEFiRet; - propConstruct(ppThis); - SetString(*ppThis, psz, len); - propConstructFinalize(*ppThis); + + CHKiRet(propConstruct(&pThis)); + CHKiRet(SetString(pThis, psz, len)); + CHKiRet(propConstructFinalize(pThis)); + *ppThis = pThis; +finalize_it: + if(iRet != RS_RET_OK) { + if(pThis != NULL) + propDestruct(&pThis); + } + RETiRet; } |