shithub: riscv

Download patch

ref: aaecded62a469505e00dd9de6f9822e8b8cc661d
parent: 684bd26f2e848ae8e2fff587529e63167659d688
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Wed May 11 04:13:33 EDT 2011

kbdfs: memleak fix

--- a/sys/src/cmd/aux/kbdfs.c
+++ b/sys/src/cmd/aux/kbdfs.c
@@ -462,15 +462,6 @@
 	}
 }
 
-enum {
-	Areq,
-	Actl,
-	Araw,
-	Aline,
-	Akbd,
-	Aend,
-};
-
 /*
  * Queue reads to cons and kbd, flushing and
  * relay data between 9p and rawchan / kbdchan.
@@ -482,6 +473,7 @@
 		Req *h;
 		Req **t;
 	} qcons, qkbd, *q;
+	enum { Areq, Actl, Araw, Aline, Akbd, Aend };
 	Alt a[Aend+1];
 	Req *req;
 	Fid *fid;
@@ -635,6 +627,7 @@
 					respond(req, nil);
 				}
 			}
+			free(s);
 			break;
 		}
 	}
--