changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: lib9p: fix listensrv() filedescriptor leaks

changeset 7407: c5e95e4f1f7b
parent 7406: 2d4a24309bdc
child 7408: 1d345066125a
author: cinap_lenrek@felloff.net
date: Fri, 04 Oct 2019 18:52:53 +0200
files: sys/src/lib9p/listen.c
description: lib9p: fix listensrv() filedescriptor leaks
     1.1--- a/sys/src/lib9p/listen.c
     1.2+++ b/sys/src/lib9p/listen.c
     1.3@@ -44,11 +44,13 @@ listenproc(void *v)
     1.4 			break;
     1.5 		}
     1.6 		
     1.7-		data = accept(ctl, ndir);
     1.8+		data = accept(nctl, ndir);
     1.9 		if(data < 0){
    1.10 			fprint(2, "%s: accept %s: %r\n", argv0, ndir);
    1.11+			close(nctl);
    1.12 			continue;
    1.13 		}
    1.14+		close(nctl);
    1.15 
    1.16 		s = emalloc9p(sizeof *s);
    1.17 		*s = *os;