summaryrefslogtreecommitdiffstats
path: root/runtime/srutils.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-22 11:33:38 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-22 11:33:38 +0200
commite04e1b50025f5fa9c26abd946190dce8f797d08f (patch)
treeb5348b56bbd4b72ff713c2650cd4661318f8e8b1 /runtime/srutils.c
parent9079f6683057c5aad0a73eb56e33a1f1445f6e65 (diff)
downloadrsyslog-e04e1b50025f5fa9c26abd946190dce8f797d08f.tar.gz
rsyslog-e04e1b50025f5fa9c26abd946190dce8f797d08f.tar.xz
rsyslog-e04e1b50025f5fa9c26abd946190dce8f797d08f.zip
enhanced test environment (including testbench)
support for enhancing probability of memory addressing failure by using non-NULL default value for malloced memory (optional, only if requested by configure option). This helps to track down some otherwise undetected issues within the testbench and is expected to be very useful in the future.
Diffstat (limited to 'runtime/srutils.c')
-rw-r--r--runtime/srutils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/srutils.c b/runtime/srutils.c
index c403b312..7ddc3ba2 100644
--- a/runtime/srutils.c
+++ b/runtime/srutils.c
@@ -158,7 +158,7 @@ uchar *srUtilStrDup(uchar *pOld, size_t len)
assert(pOld != NULL);
- if((pNew = malloc(len + 1)) != NULL)
+ if((pNew = MALLOC(len + 1)) != NULL)
memcpy(pNew, pOld, len + 1);
return pNew;
@@ -183,7 +183,7 @@ int makeFileParentDirs(uchar *szFile, size_t lenFile, mode_t mode,
assert(lenFile > 0);
len = lenFile + 1; /* add one for '\0'-byte */
- if((pszWork = malloc(sizeof(uchar) * len)) == NULL)
+ if((pszWork = MALLOC(sizeof(uchar) * len)) == NULL)
return -1;
memcpy(pszWork, szFile, len);
for(p = pszWork+1 ; *p ; p++)
@@ -326,7 +326,7 @@ rsRetVal genFileName(uchar **ppName, uchar *pDirName, size_t lenDirName, uchar *
}
lenName = lenDirName + 1 + lenFName + lenBuf + 1; /* last +1 for \0 char! */
- if((pName = malloc(sizeof(uchar) * lenName)) == NULL)
+ if((pName = MALLOC(sizeof(uchar) * lenName)) == NULL)
ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
/* got memory, now construct string */