(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:
@@ -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? */
|
||||
|
Reference in New Issue
Block a user