Module Name: src Committed By: martin Date: Sun Dec 15 15:02:17 UTC 2024
Modified Files: src/lib/libpthread [netbsd-10]: res_state.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1029): 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.7 -r1.7.2.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.7 src/lib/libpthread/res_state.c:1.7.2.1 --- src/lib/libpthread/res_state.c:1.7 Sat Feb 12 14:59:32 2022 +++ src/lib/libpthread/res_state.c Sun Dec 15 15:02:17 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: res_state.c,v 1.7 2022/02/12 14:59:32 riastradh Exp $ */ +/* $NetBSD: res_state.c,v 1.7.2.1 2024/12/15 15:02:17 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.7 2022/02/12 14:59:32 riastradh Exp $"); +__RCSID("$NetBSD: res_state.c,v 1.7.2.1 2024/12/15 15:02:17 martin Exp $"); #endif /* Need to use libc-private names for atomic operations. */ @@ -93,7 +93,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;