diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2013-10-14 11:08:48 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-10-22 08:51:31 +0200 |
commit | f9bb1b81fed053991324de84d6856ee61188aa0f (patch) | |
tree | 3ef5b167277af86d0b73099456cef19db30800d3 | |
parent | 980a535ac81b0f63ce18fc2311dab702ced7fdc6 (diff) | |
download | sssd-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'
-rw-r--r-- | src/providers/krb5/krb5_child.c | 3 |
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; } |