openbsd-ports/security/logsurfer/patches/patch-src_logsurfer_c
sturm dd946eb48e use calloc() to not core dump with malloc.conf -> J
from Ray Lai <ray at cyth.net>
2006-02-15 06:34:04 +00:00

13 lines
511 B
Plaintext

$OpenBSD: patch-src_logsurfer_c,v 1.1 2006/02/15 06:34:04 sturm Exp $
--- src/logsurfer.c.orig Mon Feb 13 21:07:38 2006
+++ src/logsurfer.c Mon Feb 13 21:07:58 2006
@@ -384,7 +384,7 @@ main(argc, argv)
*/
logline_buffer_size=4096;
logline_buffer_pos=0;
- if ( (logline_buffer=(char *)malloc(logline_buffer_size)) == NULL ) {
+ if ( (logline_buffer=(char *)calloc(logline_buffer_size,sizeof(char))) == NULL ) {
(void) fprintf(stderr, "unable to allocate memory for logline_buffer\n");
exit(99);
}