From ff9eb1d536f2c57ec216b9ce8b96d1f536984008 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Tue, 14 Sep 2010 04:31:02 +0000 Subject: performance/io-cache: fix memory leak in ioc_mknod. Signed-off-by: Raghavendra G Signed-off-by: Vijay Bellur BUG: 1438 (memory leaks) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1438 --- xlators/performance/io-cache/src/io-cache.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 0809b6a82c5..490d3168836 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -690,6 +690,8 @@ ioc_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } frame->local = NULL; + + loc_wipe (&local->file_loc); GF_FREE (local); STACK_UNWIND_STRICT (mknod, frame, op_ret, op_errno, inode, buf, @@ -729,6 +731,11 @@ ioc_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, return 0; unwind: + if (local != NULL) { + loc_wipe (&local->file_loc); + GF_FREE (local); + } + STACK_UNWIND_STRICT (mknod, frame, -1, op_errno, NULL, NULL, NULL, NULL); -- cgit