ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [16/26] incubator-ranger git commit: Ranger-495: Coverity Scan for Apache Ranger : - Null pointer issue on KnoxClient lookup manager
Date Sat, 23 May 2015 02:05:50 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/de5ea542
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/de5ea542
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/de5ea542

Branch: refs/heads/tag-policy
Commit: de5ea54217ffe910664e7844c7038876ecf76fa7
Parents: afe001b
Author: rmani <rmani@hortonworks.com>
Authored: Tue May 19 15:12:59 2015 -0700
Committer: rmani <rmani@hortonworks.com>
Committed: Tue May 19 15:15:39 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/de5ea542/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