diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-11-26 14:22:52 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-11-26 14:22:52 +0100 |
commit | 86614327c5d33da00042f0330160d9ea4804b3dc (patch) | |
tree | 6fb202d00fe2577a9ec3baf9dd32574a78dc398a /plugins/imklog/bsd.c | |
parent | dbc8762aebc66085d67bb04bb58bee56ce204596 (diff) | |
parent | 2275a915e02ca4fd1cd1b3c450b0089ae98bc907 (diff) | |
download | rsyslog-86614327c5d33da00042f0330160d9ea4804b3dc.tar.gz rsyslog-86614327c5d33da00042f0330160d9ea4804b3dc.tar.bz2 rsyslog-86614327c5d33da00042f0330160d9ea4804b3dc.zip |
Merge branch 'beta'
Conflicts:
ChangeLog
Diffstat (limited to 'plugins/imklog/bsd.c')
-rw-r--r-- | plugins/imklog/bsd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/imklog/bsd.c b/plugins/imklog/bsd.c index 0a581081..090c4e9b 100644 --- a/plugins/imklog/bsd.c +++ b/plugins/imklog/bsd.c @@ -116,7 +116,7 @@ readklog(void) uchar bufRcv[4096+1]; uchar *pRcv = NULL; /* receive buffer */ - iMaxLine = glbl.GetMaxLine(); + iMaxLine = klog_getMaxLine(); /* we optimize performance: if iMaxLine is below 4K (which it is in almost all * cases, we use a fixed buffer on the stack. Only if it is higher, heap memory @@ -127,7 +127,8 @@ readklog(void) if((size_t) iMaxLine < sizeof(bufRcv) - 1) { pRcv = bufRcv; } else { - CHKmalloc(pRcv = (uchar*) malloc(sizeof(uchar) * (iMaxLine + 1))); + if((pRcv = (uchar*) malloc(sizeof(uchar) * (iMaxLine + 1))) == NULL) + iMaxLine = sizeof(bufRcv) - 1; /* better this than noting */ } len = 0; @@ -161,7 +162,6 @@ readklog(void) if (len > 0) Syslog(LOG_INFO, pRcv); -finalize_it: if(pRcv != NULL && (size_t) iMaxLine >= sizeof(bufRcv) - 1) free(pRcv); } |