From a058fb06aa8591d61eab8b1b95c74740938263b7 Mon Sep 17 00:00:00 2001 From: Manikandan Selvaganesh Date: Mon, 23 Nov 2015 15:58:42 +0530 Subject: marker : fixing memory leak issue in marker In marker_readdirp_cbk, variable resolvedpath is not properly freed and because of which there was a memory leak. The patch fixes it. Backport of http://review.gluster.org/#/c/12719/ > Change-Id: I9d80f72e3551aa912369257da3e8e2b261a2067f > BUG: 1284419 > Signed-off-by: Manikandan Selvaganesh > Reviewed-on: http://review.gluster.org/12719 > Reviewed-by: Vijaikumar Mallikarjuna > Tested-by: Gluster Build System > Reviewed-by: Vijay Bellur Change-Id: I9d80f72e3551aa912369257da3e8e2b261a2067f BUG: 1284850 Signed-off-by: Manikandan Selvaganesh Reviewed-on: http://review.gluster.org/12733 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/marker/src/marker.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'xlators/features/marker/src') diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 1fd7a45d2a4..a3d44a078e2 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -2960,19 +2960,11 @@ marker_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, continue; } - loc.path = gf_strdup (resolvedpath); - if (!loc.path) { - gf_log (this->name, GF_LOG_ERROR, "strdup of path " - "failed for the entry %s (path: %s)", - entry->d_name, resolvedpath); - loc_wipe (&loc); - continue; - } + loc.path = resolvedpath; + resolvedpath = NULL; mq_xattr_state (this, &loc, entry->dict, entry->d_stat); loc_wipe (&loc); - GF_FREE (resolvedpath); - resolvedpath = NULL; ret = marker_key_set_ver (this, entry->dict); if (ret < 0) { -- cgit