浏览代码

Ticket #48203 - Fix coverity issues - 07/07/2015

Description:
1. Defect type: CLANG_WARNING
   389-ds-base-1.3.4.0/ldap/servers/slapd/conntable.c:161:11: warning:
   Access to field 'c_ct' results in a dereference of a null pointer
   (loaded from variable 'c')

Thanks to [email protected] for the advice:
> PR_NewLock() returns NULL then the server is severely out of some
> resource (like RAM, stack space, etc.) and probably should just exit.

https://fedorahosted.org/389/ticket/48203#comment:8
Noriko Hosoi 10 年之前
父节点
当前提交
bca0908b1e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      ldap/servers/slapd/conntable.c

+ 1 - 1
ldap/servers/slapd/conntable.c

@@ -147,7 +147,7 @@ connection_table_get_connection(Connection_Table *ct, int sd)
 				c->c_mutex = NULL;
 				c->c_mutex = NULL;
 				c->c_pdumutex = NULL;
 				c->c_pdumutex = NULL;
 				LDAPDebug( LDAP_DEBUG_ANY,"PR_NewLock failed\n",0, 0, 0 );
 				LDAPDebug( LDAP_DEBUG_ANY,"PR_NewLock failed\n",0, 0, 0 );
-				c= NULL;
+				exit(1);
 			}
 			}
 		}
 		}
 		/* Let's make sure there's no cruft left on there from the last time this connection was used. */
 		/* Let's make sure there's no cruft left on there from the last time this connection was used. */