]> git.sur5r.net Git - openldap/commitdiff
plug yet another leak
authorPierangelo Masarati <ando@openldap.org>
Wed, 29 Aug 2007 00:27:47 +0000 (00:27 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 29 Aug 2007 00:27:47 +0000 (00:27 +0000)
servers/slapd/overlays/syncprov.c

index ff36ef0a203114a4f72a2d8f43a8e6b0c30e6335..a817700622eedc180dfc723b2a0a089660e3000e 100644 (file)
@@ -2308,10 +2308,15 @@ syncprov_operational(
                                                a = attr_find( rs->sr_entry->e_attrs,
                                                        slap_schema.si_ad_contextCSN );
                                        }
-                                       free( a->a_vals );
+                                       if ( a->a_nvals != a->a_vals ) {
+                                               ber_bvarray_free( a->a_nvals );
+                                       }
+                                       a->a_nvals = NULL;
+                                       ber_bvarray_free( a->a_vals );
+                                       a->a_vals = NULL;
                                }
                                ber_bvarray_dup_x( &a->a_vals, si->si_ctxcsn, NULL );
-                               a->a_nvals = a->a_vals;
+                               ber_bvarray_dup_x( &a->a_nvals, si->si_ctxcsn, NULL );
                        }
                        ldap_pvt_thread_rdwr_runlock( &si->si_csn_rwlock );
                }