git: 9front

Download patch

ref: 1e8a9ebb0f76b0ebe8eb31d79c44324c1c1ed70f
parent: e55a309d5043031657dcabfcc0f218bf612cf815
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Mon Sep 16 13:28:49 EDT 2013

rio: fix Xfidwrite memory leak on flush

--- a/sys/src/cmd/rio/xfid.c
+++ b/sys/src/cmd/rio/xfid.c
@@ -411,6 +411,7 @@
 		case CWdata:
 			break;
 		case CWflush:
+			free(r);
 			filsyscancel(x);
 			return;
 		}
@@ -420,6 +421,7 @@
 		if(x->flushing){
 			qunlock(&x->active);
 			recv(x->flushc, nil);	/* wake up flushing xfid */
+			free(r);
 			pair.s = runemalloc(1);
 			pair.ns = 0;
 			send(cwm.cw, &pair);		/* wake up window with empty data */
--