]> git.sur5r.net Git - openldap/commitdiff
ITS#6021 minor cleanup
authorHoward Chu <hyc@openldap.org>
Sun, 5 Apr 2009 04:17:06 +0000 (04:17 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 5 Apr 2009 04:17:06 +0000 (04:17 +0000)
servers/slapd/overlays/pcache.c

index 2ad67c2f50ab6406a7ee261fb4bb3296ccfd711c..d91b6f327ccd5be368d8bb143034699d7ab84e9a 100644 (file)
@@ -1175,6 +1175,8 @@ free_query (CachedQuery* qc)
 {
        free(qc->q_uuid.bv_val);
        filter_free(qc->filter);
+       ldap_pvt_thread_rdwr_destroy( &qc->rwlock );
+       memset(qc, 0, sizeof(*qc));
        free(qc);
 }
 
@@ -1264,6 +1266,7 @@ add_query(
                new_cached_query = find_filter( op, qbase->scopes[query->scope],
                                                        query->filter, first );
                filter_free( query->filter );
+               query->filter = NULL;
        }
        Debug( pcache_debug, "TEMPLATE %p QUERIES++ %d\n",
                        (void *) templ, templ->no_of_queries, 0 );