From 66e1d231285aacaa9c8a7ccc273fcf15b0d13d29 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Mon, 2 Aug 1999 19:38:45 +0000 Subject: [PATCH] (doit): only free hp if != NULL. From: Jonas Oberg git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6678 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/telnet/telnetd/telnetd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appl/telnet/telnetd/telnetd.c b/appl/telnet/telnetd/telnetd.c index 0c868e705..c5bb24821 100644 --- a/appl/telnet/telnetd/telnetd.c +++ b/appl/telnet/telnetd/telnetd.c @@ -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? */