summaryrefslogtreecommitdiff
path: root/source3/libads/krb5_setpw.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-07 18:25:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:32 -0500
commitacf9d61421faa6c0055d57fdee7db300dc5431aa (patch)
tree5482afecfe9b4a68b9a1f18d541a3109f8143ab7 /source3/libads/krb5_setpw.c
parent3bd3be97dc8a581c0502410453091c195e322766 (diff)
downloadsamba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.gz
samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.bz2
samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.zip
r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
Diffstat (limited to 'source3/libads/krb5_setpw.c')
-rw-r--r--source3/libads/krb5_setpw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/libads/krb5_setpw.c b/source3/libads/krb5_setpw.c
index 9582574851..dadce2593c 100644
--- a/source3/libads/krb5_setpw.c
+++ b/source3/libads/krb5_setpw.c
@@ -54,7 +54,7 @@ static DATA_BLOB encode_krb5_setpw(const char *principal, const char *password)
DATA_BLOB ret;
- princ = strdup(principal);
+ princ = SMB_STRDUP(principal);
if ((c = strchr_m(princ, '/')) == NULL) {
c = princ;
@@ -156,7 +156,7 @@ static krb5_error_code build_kpasswd_request(uint16 pversion,
return ret;
}
- packet->data = (char *)malloc(ap_req->length + cipherpw.length + 6);
+ packet->data = (char *)SMB_MALLOC(ap_req->length + cipherpw.length + 6);
if (!packet->data)
return -1;
@@ -407,7 +407,7 @@ static ADS_STATUS do_krb5_kpasswd_request(krb5_context context,
free(chpw_req.data);
chpw_rep.length = 1500;
- chpw_rep.data = (char *) malloc(chpw_rep.length);
+ chpw_rep.data = (char *) SMB_MALLOC(chpw_rep.length);
if (!chpw_rep.data) {
close(sock);
free(ap_req.data);
@@ -631,7 +631,7 @@ static ADS_STATUS ads_krb5_chg_password(const char *kdc_host,
/* We have to obtain an INITIAL changepw ticket for changing password */
asprintf(&chpw_princ, "kadmin/changepw@%s",
(char *) krb5_princ_realm(context, princ));
- password = strdup(oldpw);
+ password = SMB_STRDUP(oldpw);
ret = krb5_get_init_creds_password(context, &creds, princ, password,
kerb_prompter, NULL,
0, chpw_princ, &opts);