Source-Changes-HG archive

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

[src/trunk]: src/lib/librumpclient plug fd leak in reconnect code



details:   https://anonhg.NetBSD.org/src/rev/151d121a2a1b
branches:  trunk
changeset: 761398:151d121a2a1b
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Jan 26 14:42:41 2011 +0000

description:
plug fd leak in reconnect code

diffstat:

 lib/librumpclient/rumpclient.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r 0d9bf9deff8e -r 151d121a2a1b lib/librumpclient/rumpclient.c
--- a/lib/librumpclient/rumpclient.c    Wed Jan 26 13:36:49 2011 +0000
+++ b/lib/librumpclient/rumpclient.c    Wed Jan 26 14:42:41 2011 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpclient.c,v 1.18 2011/01/24 17:47:51 pooka Exp $   */
+/*      $NetBSD: rumpclient.c,v 1.19 2011/01/26 14:42:41 pooka Exp $   */
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -489,6 +489,7 @@
        if (kq != -1)
                host_close(kq);
        kq = -1;
+       s = -1;
 
        prevreconmsg = 0;
        reconretries = 0;
@@ -497,6 +498,9 @@
        if (clispc.spc_fd != -1)
                host_close(clispc.spc_fd);
        clispc.spc_fd = -1;
+       if (s != -1)
+               close(s);
+       s = -1;
 
        /*
         * for reconnect, gate everyone out of the receiver code



Home | Main Index | Thread Index | Old Index