Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/usr.bin/ftp Pull up revision 1.156 (requested by lukem in...



details:   https://anonhg.NetBSD.org/src/rev/a55b5f11d608
branches:  netbsd-3
changeset: 575741:a55b5f11d608
user:      tron <tron%NetBSD.org@localhost>
date:      Mon May 09 16:57:55 2005 +0000

description:
Pull up revision 1.156 (requested by lukem in ticket #264):
In fetch_url(), don't call freeaddrinfo(res0) too early, as we use pointers
to its contents later in the function.
Problem found by Onno van der Linden.

diffstat:

 usr.bin/ftp/fetch.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 6653521e71d5 -r a55b5f11d608 usr.bin/ftp/fetch.c
--- a/usr.bin/ftp/fetch.c       Sat May 07 23:13:34 2005 +0000
+++ b/usr.bin/ftp/fetch.c       Mon May 09 16:57:55 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fetch.c,v 1.155 2005/01/12 22:37:41 lukem Exp $        */
+/*     $NetBSD: fetch.c,v 1.155.2.1 2005/05/09 16:57:55 tron Exp $     */
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.155 2005/01/12 22:37:41 lukem Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.155.2.1 2005/05/09 16:57:55 tron Exp $");
 #endif /* not lint */
 
 /*
@@ -732,7 +732,6 @@
                        /* success */
                        break;
                }
-               freeaddrinfo(res0);
 
                if (s < 0) {
                        warn("Can't connect to %s", host);
@@ -1275,6 +1274,8 @@
                close(s);
        if (closefunc != NULL && fout != NULL)
                (*closefunc)(fout);
+       if (res0)
+               freeaddrinfo(res0);
        FREEPTR(savefile);
        FREEPTR(user);
        FREEPTR(pass);



Home | Main Index | Thread Index | Old Index