diff options
author | Anuradha Talur <atalur@redhat.com> | 2015-12-08 17:02:23 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-12-10 23:11:13 -0800 |
commit | ddf5957d3e4e09ed750f68447492796af61f08e4 (patch) | |
tree | f63fd7f58f5ab77045cfd5c5f344d08b73dcc178 /xlators/features/index | |
parent | 4fefa3d7dbcdad1e71c74db11113ac1e74b01656 (diff) |
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 <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/12910
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/features/index')
-rw-r--r-- | xlators/features/index/src/index.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; |