]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/syntax.c
streamline group attr specification/diagnostics
[openldap] / servers / slapd / syntax.c
index 711ed6171c925dd33875410b1147d9c04cf452c1..c5b36cfdfdeaf18ef4851e8c709d84aaa2f53583 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,7 +23,6 @@
 #include <ac/socket.h>
 
 #include "slap.h"
-#include "ldap_pvt.h"
 
 struct sindexrec {
        char            *sir_name;
@@ -179,15 +178,16 @@ register_syntax(
 
        code = syn_add( syn, def, &err );
 
-       ldap_memfree( syn );
-
        if ( code ) {
                Debug( LDAP_DEBUG_ANY, "Error in register_syntax: %s %s in %s\n",
                    scherr2str(code), err, def->sd_desc );
+               ldap_syntax_free( syn );
 
                return( -1 );
        }
 
+       ldap_memfree( syn );
+
        return( 0 );
 }