]> git.sur5r.net Git - openldap/blobdiff - servers/ldapd/delete.c
Fix memory leak if duplicate attr name in at_insert
[openldap] / servers / ldapd / delete.c
index 57fe76ec072ed70cf67fdb0fa00b48bf12807900..c4a5da9ae24916cc9f7403b146b7b9c04e20549f 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright (c) 1990 Regents of the University of Michigan.
  * All rights reserved.
  * is provided ``as is'' without express or implied warranty.
  */
 
+#include "portable.h"
+
 #include <stdio.h>
+/* ac/socket.h must precede ISODE #includes or p_type must be #undeffed
+ * after it is included.  (Because ISODE uses p_type as a field name, and
+ * SunOS 5.5:sys/vtype.h defines it (and ac/socket.h indirectly includes it) */
+#include <ac/socket.h>
+
 #include <quipu/commonarg.h>
 #include <quipu/attrvalue.h>
 #include <quipu/ds_error.h>
 #include <quipu/remove.h>
 #include <quipu/dap2.h>
 #include <quipu/dua.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
 #include "lber.h"
 #include "ldap.h"
 #include "common.h"
 
-#ifdef COMPAT20
-extern int     ldap_compat;
+#ifdef HAVE_COMPAT20
 #define DELTAG (ldap_compat == 20 ? OLD_LDAP_RES_DELETE : LDAP_RES_DELETE)
 #else
 #define DELTAG LDAP_RES_DELETE
@@ -48,7 +54,6 @@ do_delete(
        int                             rc;
        struct ds_removeentry_arg       ra;
        static CommonArgs               common = default_common_args;
-       extern DN                       ldap_str2dn();
 
        Debug( LDAP_DEBUG_TRACE, "do_delete\n", 0, 0, 0 );