]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libkrb5: Fix potential double-free
authorcem <cem@FreeBSD.org>
Wed, 11 May 2016 23:25:59 +0000 (23:25 +0000)
committercem <cem@FreeBSD.org>
Wed, 11 May 2016 23:25:59 +0000 (23:25 +0000)
commit2bcae162c5c82322e1d0a8c205a96505ca3367b1
tree8b7981a88f131877ee1ba34c4d4047f36225b0e6
parent493fc2338c03047098b508c651567e0f6d060bc6
libkrb5: Fix potential double-free

If krb5_make_principal fails, tmp_creds.server may remain a pointer to freed
memory and then be double-freed.  After freeing it the first time, initialize
it to NULL, which causes subsequent krb5_free_principal calls to do the right
thing.

Reported by: Coverity
CID: 1273430
Sponsored by: EMC / Isilon Storage Division
crypto/heimdal/lib/krb5/get_cred.c