]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#7420 clarify prev commit
authorHoward Chu <hyc@openldap.org>
Sun, 28 Jan 2024 04:43:44 +0000 (04:43 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 28 Jan 2024 04:43:44 +0000 (04:43 +0000)
servers/slapd/add.c

index 3b2602f0fc9641cb58dda8d4bb4b439c233e9c3a..2e30ea51aea86761195ad0796bb72191f7aae9e6 100644 (file)
@@ -184,17 +184,18 @@ do_add( Operation *op, SlapReply *rs )
                goto done;
        }
 
+       /* after mods2entry succeeds, vals must not be freed here */
+       freevals = 0;
+
        /* make sure RDN is present in attrs */
        if ( !is_entry_glue ( op->ora_e )) {
                rs->sr_err = entry_naming_check( op->ora_e, get_relax( op ), 1, &rs->sr_text, textbuf, textlen );
                if ( rs->sr_err != LDAP_SUCCESS ) {
-                       freevals = 0;
                        send_ldap_result( op, rs );
                        goto done;
                }
        }
 
-       freevals = 0;
        oex = op->o_tmpalloc( sizeof(OpExtraDB), op->o_tmpmemctx );
        oex->oe.oe_key = (void *)do_add;
        oex->oe_db = NULL;