]> git.ipfire.org Git - thirdparty/samba.git/commit
nsswitch:krb5_plugin: Avoid a possible double free
authorAndreas Schneider <asn@samba.org>
Tue, 18 Jun 2024 13:45:53 +0000 (15:45 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 24 Jun 2024 06:14:35 +0000 (06:14 +0000)
commit36fb8a3d654a4bc75abe86376de970ebc83552c6
tree91a657d687b55c2646482cb9b0637818205b2a71
parent5b40cdf6e8885c9db6c5ffa972112f3516e4130a
nsswitch:krb5_plugin: Avoid a possible double free

Found by Covscan.

"Error: USE_AFTER_FREE (CWE-416):
samba-4.20.0rc2/nsswitch/krb5_plugin/winbind_krb5_localauth.c:122: freed_arg: ""wbcFreeMemory"" frees ""pwd"".
samba-4.20.0rc2/nsswitch/krb5_plugin/winbind_krb5_localauth.c:144: pass_freed_arg: Passing freed pointer ""pwd"" as an argument to ""wbcFreeMemory"".
  142|    break;
  143|    }
  144|->  wbcFreeMemory(pwd);
  145|    if (code != 0) {
  146|    goto out;"

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
nsswitch/krb5_plugin/winbind_krb5_localauth.c