summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-06-13 18:09:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:24 -0500
commitedcffcbe2875d749e97ddc6a685995973c09808e (patch)
tree002c4d8d124c06922318ad15b4d71138d9f27a85 /source3
parentc0e4753cfcbece7aaf2a96726146b225c9925932 (diff)
downloadsamba-edcffcbe2875d749e97ddc6a685995973c09808e.tar.gz
samba-edcffcbe2875d749e97ddc6a685995973c09808e.tar.bz2
samba-edcffcbe2875d749e97ddc6a685995973c09808e.zip
r16201: Fix Klocwork 439
(This used to be commit b369d0891afe8b777b837eaac317131232568ca7)
Diffstat (limited to 'source3')
-rw-r--r--source3/libads/krb5_setpw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/libads/krb5_setpw.c b/source3/libads/krb5_setpw.c
index 254ca7b2a3..ec2ff5afb1 100644
--- a/source3/libads/krb5_setpw.c
+++ b/source3/libads/krb5_setpw.c
@@ -528,7 +528,6 @@ ADS_STATUS ads_krb5_set_password(const char *kdc_host, const char *princ,
DEBUG(1,("Failed to parse kadmin/changepw (%s)\n", error_message(ret)));
return ADS_ERROR_KRB5(ret);
}
- free(princ_name);
/* parse the principal we got as a function argument */
ret = smb_krb5_parse_name(context, princ, &principal);
@@ -537,9 +536,12 @@ ADS_STATUS ads_krb5_set_password(const char *kdc_host, const char *princ,
krb5_free_principal(context, creds.server);
krb5_free_context(context);
DEBUG(1,("Failed to parse %s (%s)\n", princ_name, error_message(ret)));
+ free(princ_name);
return ADS_ERROR_KRB5(ret);
}
+ free(princ_name);
+
/* The creds.server principal takes ownership of this memory.
Remember to set back to original value before freeing. */
orig_realm = *krb5_princ_realm(context, creds.server);