-/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2005 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
*/
-/* Adapted for inclusion into OpenLDAP by Kurt D. Zeilenga */
-/*---
- * Copyright (C) 1999, 2000 Novell, Inc. All Rights Reserved.
+/* Portions Copyright (C) 1999, 2000 Novell, Inc. All Rights Reserved.
*
* THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS AND
* TREATIES. USE, MODIFICATION, AND REDISTRIBUTION OF THIS WORK IS SUBJECT
* OF THIS WORK OTHER THAN AS AUTHORIZED IN VERSION 2.0.1 OF THE OPENLDAP
* PUBLIC LICENSE, OR OTHER PRIOR WRITTEN CONSENT FROM NOVELL, COULD SUBJECT
* THE PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY.
- *---*/
+ *---
+ * Note: A verbatim copy of version 2.0.1 of the OpenLDAP Public License
+ * can be found in the file "build/LICENSE-2.0.1" in this distribution
+ * of OpenLDAP Software.
+ */
+/* Portions Copyright (C) The Internet Society (1997)
+ * ASN.1 fragments are from RFC 2251; see RFC for full legal notices.
+ */
#include "portable.h"
ber_tag_t tag;
BerElement *ber;
- if ( (ld==NULL) || (vlvinfop==NULL) || (ctrlp == NULL) ) {
- ld->ld_errno = LDAP_PARAM_ERROR;
- return(ld->ld_errno);
- }
+ assert( ld != NULL );
+ assert( LDAP_VALID( ld ) );
+ assert( vlvinfop != NULL );
+ assert( ctrlp != NULL );
if ((ber = ldap_alloc_ber_with_options(ld)) == NULL) {
ld->ld_errno = LDAP_NO_MEMORY;
ber_tag_t tag, berTag;
ber_len_t berLen;
+ assert( ld != NULL );
+ assert( LDAP_VALID( ld ) );
+
if (contextp) {
*contextp = NULL; /* Make sure we return a NULL if error occurs. */
}
- if (ld == NULL) {
- ld->ld_errno = LDAP_PARAM_ERROR;
- return(ld->ld_errno);
- }
-
if (ctrls == NULL) {
ld->ld_errno = LDAP_CONTROL_NOT_FOUND;
return(ld->ld_errno);