From: Volker Lendecke Date: Sat, 1 Apr 2023 09:55:10 +0000 (+0200) Subject: libsmb: Avoid an explicit ZERO_STRUCTP with calloc X-Git-Tag: talloc-2.4.1~896 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=64ea002960dba4a31a2d550d623215328f80852e;p=thirdparty%2Fsamba.git libsmb: Avoid an explicit ZERO_STRUCTP with calloc Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider --- diff --git a/source3/libsmb/libsmb_cache.c b/source3/libsmb/libsmb_cache.c index 2b32447807e..6b8a1ab4af9 100644 --- a/source3/libsmb/libsmb_cache.c +++ b/source3/libsmb/libsmb_cache.c @@ -55,14 +55,13 @@ SMBC_add_cached_server(SMBCCTX * context, { struct smbc_server_cache * srvcache = NULL; - if (!(srvcache = SMB_MALLOC_P(struct smbc_server_cache))) { + srvcache = SMB_CALLOC_ARRAY(struct smbc_server_cache, 1); + if (srvcache == NULL) { errno = ENOMEM; DEBUG(3, ("Not enough space for server cache allocation\n")); return 1; } - ZERO_STRUCTP(srvcache); - srvcache->server = newsrv; srvcache->server_name = SMB_STRDUP(server);