/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/* Portions
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*
* getattr.c
*/
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
+#include "portable.h"
#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#ifdef MACOS
#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#if defined( DOS ) || defined( _WIN32 )
-#include <malloc.h>
-#include "msdos.h"
-#else /* DOS */
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif /* DOS */
-#endif /* MACOS */
-#include "lber.h"
-#include "ldap.h"
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
#include "ldap-int.h"
char *
Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 );
- if ( (*ber = alloc_ber_with_options( ld )) == NULLBER ) {
+ if ( (*ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
+ *ber = NULL;
return( NULL );
}
== LBER_ERROR ) {
ld->ld_errno = LDAP_DECODING_ERROR;
ber_free( *ber, 0 );
+ *ber = NULL;
return( NULL );
}
if ( ber_scanf( ber, "{sx}", ld->ld_attrbuffer, &len )
== LBER_ERROR ) {
ld->ld_errno = LDAP_DECODING_ERROR;
- ber_free( ber, 0 );
+ /* ber_free( ber, 0 ); *//* don't free the BerElement */
return( NULL );
}