From 2275a915e02ca4fd1cd1b3c450b0089ae98bc907 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 24 Nov 2008 17:48:12 +0100 Subject: bugfix: imklog did not compile on freeBSD --- plugins/imklog/bsd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/imklog/bsd.c') 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); } -- cgit v1.2.3