From: djm@openbsd.org Date: Sat, 24 May 2025 11:41:51 +0000 (+0000) Subject: upstream: replace xmalloc+memset(0) with xcalloc(); from AZero13 via X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73ef0563a59f90324f8426c017f38e20341b555f;p=thirdparty%2Fopenssh-portable.git upstream: replace xmalloc+memset(0) with xcalloc(); from AZero13 via GHPR417 OpenBSD-Commit-ID: 921079436a4900325d22bd3b6a90c8d0d54f62f8 --- diff --git a/channels.c b/channels.c index 5d503025f..cd27faab2 100644 --- a/channels.c +++ b/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.443 2025/05/24 08:09:32 dtucker Exp $ */ +/* $OpenBSD: channels.c,v 1.444 2025/05/24 11:41:51 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -4677,8 +4677,7 @@ connect_to_helper(struct ssh *ssh, const char *name, int port, int socktype, * channel_connect_ctx_free() must check ai_family * and use free() not freeaddirinfo() for AF_UNIX. */ - ai = xmalloc(sizeof(*ai) + sizeof(*sunaddr)); - memset(ai, 0, sizeof(*ai) + sizeof(*sunaddr)); + ai = xcalloc(1, sizeof(*ai) + sizeof(*sunaddr)); ai->ai_addr = (struct sockaddr *)(ai + 1); ai->ai_addrlen = sizeof(*sunaddr); ai->ai_family = AF_UNIX;