ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [4/6] incubator-ranger git commit: Ranger-495: Coverity Scan for Apache Ranger : - Null pointer issue on KnoxClient lookup manager
Date Thu, 21 May 2015 22:56:18 GMT
Ranger-495: Coverity Scan for Apache Ranger : - Null pointer issue on KnoxClient lookup manager


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/b42dfb0a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/b42dfb0a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/b42dfb0a

Branch: refs/heads/tag-policy
Commit: b42dfb0a57d643374761673bf2c6ec1380d306c2
Parents: 0ed45e3
Author: rmani <rmani@hortonworks.com>
Authored: Tue May 19 15:12:59 2015 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Thu May 21 15:50:16 2015 -0700

----------------------------------------------------------------------
 .../apache/ranger/services/knox/client/KnoxResourceMgr.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/b42dfb0a/knox-agent/src/main/java/org/apache/ranger/services/knox/client/KnoxResourceMgr.java
----------------------------------------------------------------------
diff --git a/knox-agent/src/main/java/org/apache/ranger/services/knox/client/KnoxResourceMgr.java
b/knox-agent/src/main/java/org/apache/ranger/services/knox/client/KnoxResourceMgr.java
index cf551b9..34a3c40 100644
--- a/knox-agent/src/main/java/org/apache/ranger/services/knox/client/KnoxResourceMgr.java
+++ b/knox-agent/src/main/java/org/apache/ranger/services/knox/client/KnoxResourceMgr.java
@@ -101,9 +101,10 @@ public class KnoxResourceMgr {
 		}
 		
 		final KnoxClient knoxClient = new KnoxConnectionMgr().getKnoxClient(knoxUrl, knoxAdminUser,
knoxAdminPassword); 
-		
-		synchronized(knoxClient) {
-			resultList = KnoxClient.getKnoxResources(knoxClient, knoxTopologyName, knoxServiceName,knoxTopologyList,knoxServiceList);
+		if ( knoxClient != null) {
+			synchronized(knoxClient) {
+				resultList = KnoxClient.getKnoxResources(knoxClient, knoxTopologyName, knoxServiceName,knoxTopologyList,knoxServiceList);
+			}
 		}
 		return  resultList;
 	}


Mime
View raw message