Module Name:    src
Committed By:   martin
Date:           Sun Dec 15 15:04:53 UTC 2024

Modified Files:
        src/lib/libpthread [netbsd-9]: res_state.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1930):

        lib/libpthread/res_state.c: revision 1.8

libpthread: Zero-initialize res_state objects.
PR lib/58888


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.66.1 src/lib/libpthread/res_state.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/libpthread/res_state.c
diff -u src/lib/libpthread/res_state.c:1.6 src/lib/libpthread/res_state.c:1.6.66.1
--- src/lib/libpthread/res_state.c:1.6	Mon Apr 28 20:23:02 2008
+++ src/lib/libpthread/res_state.c	Sun Dec 15 15:04:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: res_state.c,v 1.6 2008/04/28 20:23:02 martin Exp $	*/
+/*	$NetBSD: res_state.c,v 1.6.66.1 2024/12/15 15:04:53 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: res_state.c,v 1.6 2008/04/28 20:23:02 martin Exp $");
+__RCSID("$NetBSD: res_state.c,v 1.6.66.1 2024/12/15 15:04:53 martin Exp $");
 #endif
 
 #include <sys/types.h>
@@ -90,7 +90,7 @@ __res_get_state(void)
 		res_state_debug("checkout from list", st);
 	} else {
 		pthread_mutex_unlock(&res_mtx);
-		st = malloc(sizeof(*st));
+		st = calloc(1, sizeof(*st));
 		if (st == NULL) {
 			h_errno = NETDB_INTERNAL;
 			return NULL;

Reply via email to