From 63c050d16ca6926933b42c7b93d2b09b9045b7b9 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 11 Jul 2000 09:31:19 +0000 Subject: Try and fix the worst of some highly bogus malloc/free resource management involving rcmd_af(), getaddrinfo(), freeaddrinfo(), etc. We set *ahost to point to ai->canonname; and later free the ai-> stuff and still leave the old pointers in *ahost to the freed data. Perhaps the best way to deal with this is a static buffer or a static strdup() that is freed on the next iteration or something. This gives me headaches just thinking about this. The new 'AJ' default for malloc() tripped this up. --- lib/libc/net/rcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc') diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index 5bbef4b..70a18d4 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -182,8 +182,8 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af) refused = 0; continue; } - freeaddrinfo(res); (void)fprintf(stderr, "%s: %s\n", *ahost, strerror(errno)); + freeaddrinfo(res); sigsetmask(oldmask); return (-1); } -- cgit v1.1