Avoid potential memory leak in krb5_sendto_set_hostname
commit766e6cda8af38d4ef4194b283b3043b1dd056c5d
authorViktor Dukhovni <viktor@twosigma.com>
Tue, 22 Aug 2017 21:56:19 +0000 (22 21:56 +0000)
committerNico Williams <nico@cryptonector.com>
Wed, 23 Aug 2017 20:10:38 +0000 (23 15:10 -0500)
tree125b066e8ccbebe45467fb7c9c329ca576242f90
parentd73ec2510ac2b1f86cf03a30b903034b7a446f83
Avoid potential memory leak in krb5_sendto_set_hostname

If the hostname was already set, a typo in a test meant we were not
freeing it.  While we're at it, handle the unlikely possibility that
the existing pointer is passed as the new value.
lib/krb5/send_to_kdc.c