Browse Source

Ticket #48048 - Fix coverity issues - 2015/2/24

Coverity defect 13038 - Explicit null dereferenced (FORWARD_NULL)
Description:  Added NULL check for pb_operation.
modified: roles_cache_change_notify in roles_cache.c
Noriko Hosoi 10 years ago
parent
commit
3e3ed4869d
1 changed files with 11 additions and 11 deletions
  1. 11 11
      ldap/servers/plugins/roles/roles_cache.c

+ 11 - 11
ldap/servers/plugins/roles/roles_cache.c

@@ -815,21 +815,21 @@ void roles_cache_change_notify(Slapi_PBlock *pb)
 		return;
 	}
 
-    /* Don't update local cache when remote entries are updated */
-    slapi_pblock_get( pb, SLAPI_BACKEND, &be );
-    if ( 	( be==NULL ) ||
-			( slapi_be_is_flag_set(be,SLAPI_BE_FLAG_REMOTE_DATA)) )
-	{
+	/* Don't update local cache when remote entries are updated */
+	slapi_pblock_get(pb, SLAPI_BACKEND, &be);
+	if ((be == NULL) || (slapi_be_is_flag_set(be,SLAPI_BE_FLAG_REMOTE_DATA))) {
 		return;
 	}
 
-    slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn);
-    if( sdn == NULL )
-    {
-        return;
-    }
+	slapi_pblock_get(pb, SLAPI_TARGET_SDN, &sdn);
+	if(sdn == NULL) {
+		return;
+	}
 
-	slapi_pblock_get (pb, SLAPI_OPERATION, &pb_operation);
+	slapi_pblock_get(pb, SLAPI_OPERATION, &pb_operation);
+	if (NULL == pb_operation) {
+		return;
+	}
 	operation = operation_get_type(pb_operation);
 
 	switch (operation)