]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
auth/kerberos: fix PAC data leak on unparse failure gitlab/master
authorXuqing Yang <rigelyoung@icloud.com>
Sun, 9 Aug 2026 02:42:59 +0000 (10:42 +0800)
committerAnoop C S <anoopcs@samba.org>
Tue, 11 Aug 2026 09:06:09 +0000 (09:06 +0000)
kerberos_create_pac() returns directly when
krb5_unparse_name_flags() fails, leaking the caller-owned
pac_data hierarchy. Free pac_data before returning the error.

Signed-off-by: Xuqing Yang <rigelyoung@icloud.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Tue Aug 11 09:06:09 UTC 2026 on atb-devel-224

source4/auth/kerberos/kerberos_pac.c

index 4ba2bf0fe9f45b5d762f9cde92b587da43bd87b1..6c7bf7aed8a71290212d0774e1019630f19faa27 100644 (file)
                                      KRB5_PRINCIPAL_UNPARSE_DISPLAY,
                                      &name);
        if (ret) {
+               talloc_free(pac_data);
                return ret;
        }
        LOGON_NAME->account_name        = talloc_strdup(LOGON_NAME, name);