Module Name:    src
Committed By:   dholland
Date:           Thu Jun 10 05:24:56 UTC 2010

Modified Files:
        src/lib/libcurses: screen.c

Log Message:
After consultation with jdc@, apply the patch from PR 42412 even though
the crash went away -- it's not clear that it went away for any reason
besides by accident.

The change is: use calloc instead of malloc for allocating SCREENs.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libcurses/screen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libcurses/screen.c
diff -u src/lib/libcurses/screen.c:1.22 src/lib/libcurses/screen.c:1.23
--- src/lib/libcurses/screen.c:1.22	Wed Feb  3 15:34:40 2010
+++ src/lib/libcurses/screen.c	Thu Jun 10 05:24:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: screen.c,v 1.22 2010/02/03 15:34:40 roy Exp $	*/
+/*	$NetBSD: screen.c,v 1.23 2010/06/10 05:24:55 dholland Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)screen.c	8.2 (blymn) 11/27/2001";
 #else
-__RCSID("$NetBSD: screen.c,v 1.22 2010/02/03 15:34:40 roy Exp $");
+__RCSID("$NetBSD: screen.c,v 1.23 2010/06/10 05:24:55 dholland Exp $");
 #endif
 #endif					/* not lint */
 
@@ -117,7 +117,7 @@
 	if ((type == NULL) && (sp = getenv("TERM")) == NULL)
 		return NULL;
 
-	if ((new_screen = (SCREEN *) malloc(sizeof(SCREEN))) == NULL)
+	if ((new_screen = calloc(1, sizeof(SCREEN))) == NULL)
 		return NULL;
 
 #ifdef DEBUG

Reply via email to