]> git.sur5r.net Git - openldap/commitdiff
cleanup NULL deref
authorHoward Chu <hyc@openldap.org>
Fri, 31 Mar 2006 21:20:36 +0000 (21:20 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 31 Mar 2006 21:20:36 +0000 (21:20 +0000)
libraries/libldap_r/rdwr.c

index 81febcbd2dbaa39f550bc3bba0a466a86ab10643..45f642de4f46b0815959615c3803b0ffd7e76210 100644 (file)
@@ -78,6 +78,8 @@ ldap_pvt_thread_rdwr_init( ldap_pvt_thread_rdwr_t *rwlock )
 
        rw = (struct ldap_int_thread_rdwr_s *) LDAP_CALLOC( 1,
                sizeof( struct ldap_int_thread_rdwr_s ) );
+       if ( !rw )
+               return LDAP_NO_MEMORY;
 
        /* we should check return results */
        ldap_pvt_thread_mutex_init( &rw->ltrw_mutex );