dlz_bind9: Fix the named crash on reloading named
authorAmitay Isaacs <amitay@gmail.com>
Wed, 23 May 2012 01:52:16 +0000 (11:52 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Wed, 23 May 2012 23:42:24 +0000 (09:42 +1000)
commit34eab45cba6989b66d37c7eb74d97846014ec4eb
tree615f2a5b9c1e0d41af402009013654b804294865
parente8601c02ba59fb12b46919a50702365ceee6aee1
dlz_bind9: Fix the named crash on reloading named

When reloading zones, named first creates new zone instance and then shuts down
the old instance. Since ldb layer, keeps the same LDB open, talloc_free() on samdb
handle, causes talloc "access after use" error.

This patch keeps only single context (dlz_bind9_data) and uses reference counting
to decide when to actually free the context. Since samdb handle is reused, use
talloc_unlink() instead of talloc_free() on samdb handle.
source4/dns_server/dlz_bind9.c