From 13da51ef8c052ac600cfeec1738d04d9926bf4ce Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Feb 28 2015 01:57:35 +0000 Subject: 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 --- diff --git a/ldap/servers/plugins/roles/roles_cache.c b/ldap/servers/plugins/roles/roles_cache.c index 16e450f..3f9b4d9 100644 --- a/ldap/servers/plugins/roles/roles_cache.c +++ b/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)