]> git.sur5r.net Git - openldap/commitdiff
ITS#8215 Remove a memory leak
authorOndřej Kuzník <ondra@mistotebe.net>
Tue, 11 Aug 2015 12:26:39 +0000 (14:26 +0200)
committerHoward Chu <hyc@openldap.org>
Sun, 25 Oct 2015 09:01:46 +0000 (09:01 +0000)
servers/slapd/slapmodify.c

index b3cf23df670032d20fa01de18207b9dc5e71eca5..63166c377e869b7341586f8bfa76d3c719262cea 100644 (file)
@@ -425,12 +425,13 @@ slapmodify( int argc, char **argv )
                                        break;
                                }
 
+                               ber_bvarray_free( mods.sm_values );
+                               ber_bvarray_free( mods.sm_nvalues );
+
                                if ( local_rc != LDAP_SUCCESS ) {
                                        fprintf( stderr, "%s: DN=\"%s\": unable to modify attr=%s\n",
                                                progname, e->e_dn, mods.sm_desc->ad_cname.bv_val );
                                        rc = EXIT_FAILURE;
-                                       ber_bvarray_free( mods.sm_values );
-                                       ber_bvarray_free( mods.sm_nvalues );
                                        goto cleanup;
                                }
                        }