From ddf5957d3e4e09ed750f68447492796af61f08e4 Mon Sep 17 00:00:00 2001 From: Anuradha Talur Date: Tue, 8 Dec 2015 17:02:23 +0530 Subject: features/index : Prevent logging due to NULL dict Added a check for non-NULLness of dict before performing dict_foreach_match on it. Change-Id: I77d83559934006425ed33745b8a244b2f5d90cb1 BUG: 1250803 Signed-off-by: Anuradha Talur Reviewed-on: http://review.gluster.org/12910 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/features/index/src/index.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators/features/index/src/index.c') diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index f08cdb1d200..8350e79c412 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -609,11 +609,11 @@ index_find_xattr_type (dict_t *d, char *k, data_t *v) int idx = -1; index_priv_t *priv = THIS->private; - if (is_xattr_in_watchlist (d, k, v, - priv->dirty_watchlist)) + if (priv->dirty_watchlist && is_xattr_in_watchlist (d, k, v, + priv->dirty_watchlist)) idx = DIRTY; - else if (is_xattr_in_watchlist (d, k, v, - priv->pending_watchlist)) + else if (priv->pending_watchlist && is_xattr_in_watchlist (d, k, v, + priv->pending_watchlist)) idx = PENDING; return idx; -- cgit