mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
libsmb: Avoid an explicit ZERO_STRUCTP with calloc
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
061aaf8622
commit
64ea002960
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user