mirror of
https://git.FreeBSD.org/ports.git
synced 2024-10-31 21:57:12 +00:00
c86362a6ac
Submitted by: MIHIRA Yoshiro <sanpei@yy.cs.keio.ac.jp>
45 lines
930 B
Plaintext
45 lines
930 B
Plaintext
--- src/finger.c.org Sat Jul 6 14:31:03 1996
|
|
+++ src/finger.c Sat Jul 6 16:23:39 1996
|
|
@@ -107,7 +107,6 @@
|
|
char *arg, *port;
|
|
int optc;
|
|
|
|
-
|
|
default_error_handling (argv[0]);
|
|
|
|
/* Parse the arguments passed on the command line. */
|
|
@@ -192,6 +191,7 @@
|
|
long addr;
|
|
char *finger_server = NULL;
|
|
int suppress_hostname = 0;
|
|
+ int malloc_flag = 0;
|
|
|
|
|
|
username = savestring (arg);
|
|
@@ -204,7 +204,7 @@
|
|
hostname = NULL;
|
|
|
|
if ((!username || !*username)
|
|
- && (finger_server = getservhost ()))
|
|
+ && (finger_server = getservhost (stderr)))
|
|
{
|
|
hostname = finger_server;
|
|
suppress_hostname = 1;
|
|
@@ -237,6 +237,7 @@
|
|
{
|
|
host = (struct hostent *) xmalloc (sizeof (struct hostent));
|
|
host->h_name = hostname;
|
|
+ malloc_flag = 1;
|
|
}
|
|
}
|
|
else
|
|
@@ -296,6 +297,7 @@
|
|
if (finger_server)
|
|
free (finger_server);
|
|
|
|
- if (host)
|
|
+ if (malloc_flag) {
|
|
free (host);
|
|
+ }
|
|
}
|