]> granicus.if.org Git - php/commitdiff
always initialize mod_type
authorAntony Dovgal <tony2001@php.net>
Wed, 16 Apr 2008 13:19:31 +0000 (13:19 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 16 Apr 2008 13:19:31 +0000 (13:19 +0000)
ext/ldap/ldap.c

index 044388a0edcdb9cf68e64740e92c9a6ddb77de30..06274a4bfd237a384e85def6a54f7782f782a5e5 100644 (file)
@@ -1322,6 +1322,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
        for (i = 0; i < num_attribs; i++) {
                ldap_mods[i] = emalloc(sizeof(LDAPMod));
                ldap_mods[i]->mod_op = oper | LDAP_MOD_BVALUES;
+               ldap_mods[i]->mod_type = NULL;
 
                res = zend_hash_get_current_key_ex(Z_ARRVAL_P(entry), &attribute, &attribute_len, &index, 0, NULL);
                if (res == HASH_KEY_IS_STRING) {
@@ -1331,7 +1332,6 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
                        if (tmp) {
                                ldap_mods[i]->mod_type = estrdup(tmp);
                        } else {
-                               ldap_mods[i]->mod_type = NULL;
                                goto error_out;
                        }
                } else {