t9pserve: fix memory leak in warning - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit d5791246822e27ef99a593d11518b457ce439a85
parent 3473f4e5fde931d4988c84aa46ca3dbcf9c1150d
Author: Ray Lai 
Date:   Fri, 19 Jan 2018 00:39:41 +0800

9pserve: fix memory leak in warning

Diffstat:
  M src/cmd/9pserve.c                   |       2 ++

1 file changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/cmd/9pserve.c b/src/cmd/9pserve.c
t@@ -1248,6 +1248,8 @@ mread9p(Ioproc *io, int fd)
         nn = convM2S(pkt, n, &m->tx);
         if(nn != n){
                 fprint(2, "%T read bad packet from %d\n", fd);
+                free(m->tpkt);
+                free(m);
                 return nil;
         }
         return m;