summaryrefslogtreecommitdiff
path: root/runtime/prop.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2014-08-18 17:48:20 +0200
committerMichael Biebl <biebl@debian.org>2014-08-18 17:48:20 +0200
commit1dfcd909d90f6fad4a612b6fd998d7473a9da399 (patch)
treeb9fb75cfd347088f1850b48e298c5db564304ece /runtime/prop.c
parentdaeb0d03d4a65fa118ad25b34958fb9cacbbd6f4 (diff)
downloadrsyslog-1dfcd909d90f6fad4a612b6fd998d7473a9da399.tar.gz
Imported Upstream version 8.4.0upstream/8.4.0
Diffstat (limited to 'runtime/prop.c')
-rw-r--r--runtime/prop.c17
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;
}