From c5eb686096c8e5fef13230867ea7ce494b0376d7 Mon Sep 17 00:00:00 2001 From: rsc Date: Wed, 16 Jun 2004 03:12:39 +0000 Subject: extra assertion, fix leak in vtread --- src/libventi/client.c | 1 + src/libventi/file.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'src/libventi') diff --git a/src/libventi/client.c b/src/libventi/client.c index 5d51cc7d..a58b2089 100644 --- a/src/libventi/client.c +++ b/src/libventi/client.c @@ -98,6 +98,7 @@ vtread(VtConn *z, uchar score[VtScoreSize], uint type, uchar *buf, int n) nn = packetsize(p); if(packetconsume(p, buf, nn) < 0) abort(); + packetfree(p); return nn; } diff --git a/src/libventi/file.c b/src/libventi/file.c index 655b3891..50e99f3c 100644 --- a/src/libventi/file.c +++ b/src/libventi/file.c @@ -190,6 +190,8 @@ vtfilecreate(VtFile *r, int psize, int dsize, int dir) u32int offset; assert(ISLOCKED(r)); + assert(psize <= VtMaxLumpSize); + assert(dsize <= VtMaxLumpSize); if(!r->dir){ werrstr(ENotDir); -- cgit v1.2.3