[hackers] [libixp] Free client message buffer on unmount.

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri Jun 01 19:59:01 2007

changeset: 59:21aed24cae3a
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Fri Jun 01 13:57:38 2007 -0400
summary: Free client message buffer on unmount.

diff -r c1d4278c398d -r 21aed24cae3a libixp/client.c
--- a/libixp/client.c Tue Apr 17 18:16:48 2007 -0400
+++ b/libixp/client.c Fri Jun 01 13:57:38 2007 -0400
@@ -91,6 +91,7 @@ ixp_unmount(IxpClient *c) {
 ixp_unmount(IxpClient *c) {
         shutdown(c->fd, SHUT_RDWR);
         close(c->fd);
+ free(c->msg.data);
         free(c);
 }
 
@@ -358,6 +359,8 @@ ixp_read(IxpCFid *f, void *buf, uint cou
                 fcall.offset = f->offset;
                 fcall.count = n;
                 if(dofcall(f->client, &fcall) == 0)
+ return -1;
+ if(fcall.count > n)
                         return -1;
 
                 memcpy(buf+len, fcall.data, fcall.count);
Received on Fri Jun 01 2007 - 19:59:01 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:14 UTC