Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
{
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);