commit ec70dd77d2d5e7d67a45b627bfa1599bb4fb11c9
parent f95a2ab7d539e21085ee826657f4d87cd360b4f0
Author: Kris Maglione <jg@suckless.org>
Date: Mon, 12 Mar 2007 01:33:51 -0400
Free data after you use it, not before.
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/client.c b/client.c
@@ -93,7 +93,7 @@ ixp_client_create(IXPClient *c, uint dirfid, char *name,
int
ixp_client_walk(IXPClient *c, uint newfid, char *filepath) {
- uint i;
+ int i;
char *wname[IXP_MAX_WELEM], *fp;
c->ifcall.type = TWALK;
@@ -105,9 +105,10 @@ ixp_client_walk(IXPClient *c, uint newfid, char *filepath) {
c->ifcall.nwname = ixp_tokenize(wname, IXP_MAX_WELEM, fp, '/'); // was "c->ifcall.name"
for(i = 0; i < c->ifcall.nwname; i++)
c->ifcall.wname[i] = wname[i];
- free(fp);
}
- return ixp_client_do_fcall(c);
+ i = ixp_client_do_fcall(c);
+ free(fp);
+ return i;
}
int