]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/pagectrl.c
Make LDAP_MEMORY_DEBUG a bitmask. #define LDAP_MEMORY_DEBUG_ASSERT. ITS#4990.
[openldap] / libraries / libldap / pagectrl.c
index 40093cb6fd5ed48ead9b6d6d3d8cd16b6a1a9ace..df4978705d8401bc22770a8dd8a55bb5b2c029fd 100644 (file)
@@ -1,6 +1,6 @@
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * Copyright 2006 Hans Leidekker
  * All rights reserved.
  *
@@ -12,9 +12,6 @@
  * top-level directory of the distribution or, alternatively, at
  * <http://www.OpenLDAP.org/license.html>.
  */
-/* Portions Copyright (C) The Internet Society (1999)
- * ASN.1 fragments are from RFC 2696; see RFC for full legal notices.
- */
 
 #include "portable.h"
 
@@ -65,8 +62,9 @@ ldap_create_page_control_value(
        if ( ld == NULL || value == NULL ||
                pagesize < 1 || pagesize > LDAP_MAXINT )
        {
-               ld->ld_errno = LDAP_PARAM_ERROR;
-               return ld->ld_errno;
+               if ( ld )
+                       ld->ld_errno = LDAP_PARAM_ERROR;
+               return LDAP_PARAM_ERROR;
        }
 
        assert( LDAP_VALID( ld ) );
@@ -195,8 +193,9 @@ ldap_parse_pageresponse_control(
        ber_int_t count;
 
        if ( ld == NULL || ctrl == NULL || cookie == NULL ) {
-               ld->ld_errno = LDAP_PARAM_ERROR;
-               return ld->ld_errno;
+               if ( ld )
+                       ld->ld_errno = LDAP_PARAM_ERROR;
+               return LDAP_PARAM_ERROR;
        }
 
        /* Create a BerElement from the berval returned in the control. */