summaryrefslogtreecommitdiffstats
path: root/tools/syslogd.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 /tools/syslogd.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 'tools/syslogd.c')
-rw-r--r--tools/syslogd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 07829e46..cf37e1f0 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -447,7 +447,7 @@ static char **crunch_list(char *list)
for (count=i=0; p[i]; i++)
if (p[i] == LIST_DELIMITER) count++;
- if ((result = (char **)malloc(sizeof(char *) * (count+2))) == NULL) {
+ if ((result = (char **)MALLOC(sizeof(char *) * (count+2))) == NULL) {
printf ("Sorry, can't get enough memory, exiting.\n");
exit(0); /* safe exit, because only called during startup */
}
@@ -459,7 +459,7 @@ static char **crunch_list(char *list)
*/
count = 0;
while ((q=strchr(p, LIST_DELIMITER))) {
- result[count] = (char *) malloc((q - p + 1) * sizeof(char));
+ result[count] = (char *) MALLOC((q - p + 1) * sizeof(char));
if (result[count] == NULL) {
printf ("Sorry, can't get enough memory, exiting.\n");
exit(0); /* safe exit, because only called during startup */
@@ -470,7 +470,7 @@ static char **crunch_list(char *list)
count++;
}
if ((result[count] = \
- (char *)malloc(sizeof(char) * strlen(p) + 1)) == NULL) {
+ (char *)MALLOC(sizeof(char) * strlen(p) + 1)) == NULL) {
printf ("Sorry, can't get enough memory, exiting.\n");
exit(0); /* safe exit, because only called during startup */
}
@@ -828,7 +828,7 @@ int parseRFCSyslogMsg(msg_t *pMsg, int flags)
* message, so we can not run into any troubles. I think this is
* more wise then to use individual buffers.
*/
- if((pBuf = malloc(sizeof(uchar) * (lenMsg + 1))) == NULL)
+ if((pBuf = MALLOC(sizeof(uchar) * (lenMsg + 1))) == NULL)
return 1;
/* IMPORTANT NOTE:
@@ -1208,7 +1208,7 @@ void legacyOptsEnq(uchar *line)
{
legacyOptsLL_t *pNew;
- pNew = malloc(sizeof(legacyOptsLL_t));
+ pNew = MALLOC(sizeof(legacyOptsLL_t));
if(line == NULL)
pNew->line = NULL;
else
@@ -2661,7 +2661,7 @@ bufOptAdd(char opt, char *arg)
DEFiRet;
bufOpt_t *pBuf;
- if((pBuf = malloc(sizeof(bufOpt_t))) == NULL)
+ if((pBuf = MALLOC(sizeof(bufOpt_t))) == NULL)
ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
pBuf->optchar = opt;