summaryrefslogtreecommitdiffstats
path: root/src/providers/krb5
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:51:31 +0200
commitf9bb1b81fed053991324de84d6856ee61188aa0f (patch)
tree3ef5b167277af86d0b73099456cef19db30800d3 /src/providers/krb5
parent980a535ac81b0f63ce18fc2311dab702ced7fdc6 (diff)
downloadsssd-f9bb1b81fed053991324de84d6856ee61188aa0f.tar.gz
sssd-f9bb1b81fed053991324de84d6856ee61188aa0f.tar.xz
sssd-f9bb1b81fed053991324de84d6856ee61188aa0f.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')
-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 f96bc8aae..bd937e808 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;
}