]> git.sur5r.net Git - openldap/commitdiff
fix cleanup on error
authorPierangelo Masarati <ando@openldap.org>
Mon, 22 Aug 2005 16:01:16 +0000 (16:01 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 22 Aug 2005 16:01:16 +0000 (16:01 +0000)
servers/slapd/syntax.c

index 0469e308cb9b2a64de156106d7b837252021e6ca..286ece7e2f781fdee859f2f3cef0000f80a36709 100644 (file)
@@ -178,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 );
 }