summaryrefslogtreecommitdiffstats
path: root/src/providers/krb5/krb5_child.c
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-10-14 11:08:48 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-10-22 08:53:46 +0200
commit278cc6555abf28d60394e5696c7885608a7924aa (patch)
tree135ea550127cc5e67e0bda42c0166ffd56e6294f /src/providers/krb5/krb5_child.c
parent92d67a0fa2de353cc930d498653856cef1574025 (diff)
downloadsssd-278cc6555abf28d60394e5696c7885608a7924aa.tar.gz
sssd-278cc6555abf28d60394e5696c7885608a7924aa.tar.xz
sssd-278cc6555abf28d60394e5696c7885608a7924aa.zip
krb5: Use right function to free data.
In function create_empty_cred, krb5_creds was aloocated using calloc, but krb5_free_creds was used to remove this creds in done section. Therefore clang static analyzer repoted this as warning: Potential leak of memory pointed to by 'cred'
Diffstat (limited to 'src/providers/krb5/krb5_child.c')
-rw-r--r--src/providers/krb5/krb5_child.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index 90ebcff45..aa29de0cb 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -424,7 +424,8 @@ static krb5_error_code create_empty_cred(krb5_context ctx, krb5_principal princ,
done:
if (kerr != 0) {
- krb5_free_creds(ctx, cred);
+ krb5_free_cred_contents(ctx, cred);
+ free(cred);
} else {
*_cred = cred;
}