diff options
author | Jeremy Allison <jra@samba.org> | 2004-12-20 21:14:28 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:53:42 -0500 |
commit | b46913fb95d59f3ec8e7e71da758cd16cda05f2c (patch) | |
tree | d76c481d3fc054023e3ea37ae4858016bce5636c /source3/libsmb | |
parent | 84e0aafc78f9d91cde3a6b1c4a57d8ed3b6fd58c (diff) | |
download | samba-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.c | 5 |
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++) { |