summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-20 21:14:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:42 -0500
commitb46913fb95d59f3ec8e7e71da758cd16cda05f2c (patch)
treed76c481d3fc054023e3ea37ae4858016bce5636c /source3/libsmb
parent84e0aafc78f9d91cde3a6b1c4a57d8ed3b6fd58c (diff)
downloadsamba-b46913fb95d59f3ec8e7e71da758cd16cda05f2c.tar.gz
samba-b46913fb95d59f3ec8e7e71da758cd16cda05f2c.tar.bz2
samba-b46913fb95d59f3ec8e7e71da758cd16cda05f2c.zip
r4291: More *alloc fixes inspired by Albert Chin (china@thewrittenword.com).
Jeremy (This used to be commit efc1b688cf9b1a17f1a6bf46d481280ed8bd0c46)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clikrb5.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index 15be8967b8..66c16b69ae 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -233,7 +233,7 @@
return -1;
}
- sa = malloc( sizeof(struct sockaddr) * num_kdcs );
+ sa = SMB_MALLOC_ARRAY( struct sockaddr, num_kdcs );
if (!sa) {
DEBUG(0, ("krb5_locate_kdc: malloc failed\n"));
krb5_krbhst_free(ctx, hnd);
@@ -241,8 +241,7 @@
return -1;
}
- *addr_pp = malloc(sizeof(struct sockaddr) * num_kdcs);
- memset(*addr_pp, '\0', sizeof(struct sockaddr) * num_kdcs );
+ memset(sa, '\0', sizeof(struct sockaddr) * num_kdcs );
for (i = 0; i < num_kdcs && (rc = krb5_krbhst_next(ctx, hnd, &hinfo) == 0); i++) {