(doit): only free hp if != NULL. From: Jonas Oberg <jonas@coyote.org>

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6678 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-08-02 19:38:45 +00:00
parent 629e07b569
commit 66e1d23128

View File

@@ -663,7 +663,7 @@ static void
doit(struct sockaddr *who, int who_len)
{
char *host = NULL;
struct hostent *hp;
struct hostent *hp = NULL;
int level;
int ptynum;
char user_name[256];
@@ -741,7 +741,8 @@ Please contact your net administrator");
* to also do a gethost* and overwrite the static data...
*/
strcpy_truncate(remote_host_name, host, sizeof(remote_host_name));
freehostent (hp);
if (hp != NULL)
freehostent (hp);
host = remote_host_name;
/* XXX - should be k_gethostname? */