Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/tftp call freeaddrinfo() after getaddrinfo() to recl...



details:   https://anonhg.NetBSD.org/src/rev/6586cb913d89
branches:  trunk
changeset: 474621:6586cb913d89
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Jul 12 20:50:54 1999 +0000

description:
call freeaddrinfo() after getaddrinfo() to reclaim results.

diffstat:

 usr.bin/tftp/main.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 214fd7e04c81 -r 6586cb913d89 usr.bin/tftp/main.c
--- a/usr.bin/tftp/main.c       Mon Jul 12 20:46:15 1999 +0000
+++ b/usr.bin/tftp/main.c       Mon Jul 12 20:50:54 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.11 1999/07/12 20:19:20 itojun Exp $ */
+/*     $NetBSD: main.c,v 1.12 1999/07/12 20:50:54 itojun Exp $ */
 
 /*
  * Copyright (c) 1983, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: main.c,v 1.11 1999/07/12 20:19:20 itojun Exp $");
+__RCSID("$NetBSD: main.c,v 1.12 1999/07/12 20:50:54 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -184,8 +184,8 @@
        if (connected) {
                close(f);
                f = -1;
-               connected = 0;
        }
+       connected = 0;
 
        memset(&hints, 0, sizeof(hints));
        hints.ai_family = PF_UNSPEC;
@@ -232,6 +232,8 @@
                hostname[sizeof(hostname)-1] = 0;
                connected = 1;
        }
+
+       freeaddrinfo(res0);
 }
 
 void



Home | Main Index | Thread Index | Old Index