]> git.sur5r.net Git - openldap/commitdiff
plug leak (ITS#5302)
authorPierangelo Masarati <ando@openldap.org>
Sat, 29 Dec 2007 17:59:28 +0000 (17:59 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 29 Dec 2007 17:59:28 +0000 (17:59 +0000)
servers/slapd/overlays/memberof.c

index 3a5c6ac4c0d1b1ef95d66b20010dbce0ae49467e..50d018d0dd2cb9197fbad3e115a3f1608c6f284e 100644 (file)
@@ -232,6 +232,14 @@ memberof_saved_member_set( Operation *op, void *keyp, BerVarray vals )
                *key = saved_vals;
 
        } else {
+               BerVarray       old_vals = NULL;
+
+               ldap_pvt_thread_pool_getkey( op->o_threadctx,
+                               key, (void **)&old_vals, NULL );
+               if ( old_vals != NULL ) {
+                       ber_bvarray_free( old_vals );
+               }
+
                ldap_pvt_thread_pool_setkey( op->o_threadctx, key,
                                saved_vals, memberof_saved_member_free );
        }
@@ -1218,6 +1226,7 @@ memberof_res_delete( Operation *op, SlapReply *rs )
                                        NULL, NULL );
                }
 
+               memberof_saved_member_set( op, &saved_memberof_vals, NULL );
                ber_bvarray_free( vals );
        }
 
@@ -1231,6 +1240,7 @@ memberof_res_delete( Operation *op, SlapReply *rs )
                                                NULL, NULL );
                        }
 
+                       memberof_saved_member_set( op, &saved_member_vals, NULL );
                        ber_bvarray_free( vals );
                }
        }