]> git.sur5r.net Git - openldap/commitdiff
clear code before calling functions that may modify it
authorPierangelo Masarati <ando@openldap.org>
Thu, 18 Aug 2005 18:48:02 +0000 (18:48 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 18 Aug 2005 18:48:02 +0000 (18:48 +0000)
libraries/libldap/schema.c

index 7cd432d7ff2be1f73beb419fe20fdae28412c645..3a472391d5d4378371c52fd31c59cfec03d770b6 100644 (file)
@@ -2439,6 +2439,7 @@ ldap_str2objectclass( LDAP_CONST char * s,
                                }
                        }
                        LDAP_FREE(sval);
+                       *code = 0;
                } else {
                        *errp = ss;
                        ldap_objectclass_free(oc);
@@ -2527,6 +2528,7 @@ ldap_str2objectclass( LDAP_CONST char * s,
                                        ldap_objectclass_free(oc);
                                        return NULL;
                                }
+                               *code = 0;
                        } else if ( !strcasecmp(sval,"ABSTRACT") ) {
                                LDAP_FREE(sval);
                                if ( seen_kind ) {
@@ -2575,6 +2577,7 @@ ldap_str2objectclass( LDAP_CONST char * s,
                                        ldap_objectclass_free(oc);
                                        return NULL;
                                }
+                               *code = 0;
                                parse_whsp(&ss);
                        } else if ( !strcasecmp(sval,"MAY") ) {
                                LDAP_FREE(sval);
@@ -2591,10 +2594,12 @@ ldap_str2objectclass( LDAP_CONST char * s,
                                        ldap_objectclass_free(oc);
                                        return NULL;
                                }
+                               *code = 0;
                                parse_whsp(&ss);
                        } else if ( sval[0] == 'X' && sval[1] == '-' ) {
                                /* Should be parse_qdstrings */
                                ext_vals = parse_qdescrs(&ss, code);
+                               *code = 0;
                                if ( !ext_vals ) {
                                        *errp = ss;
                                        ldap_objectclass_free(oc);