fixed use of reference in pytalloc
authorAndrew Tridgell <tridge@samba.org>
Wed, 1 Jul 2009 04:05:17 +0000 (14:05 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 1 Jul 2009 05:15:37 +0000 (15:15 +1000)
commit956b5a0003a3ab82d2d7cffb7aee6e5281b4fbb4
treeb31ce346b11cbada4b39dd63134c6a6feb8fe903
parent2d981919b8dd63655a39ccaa4fd7bdb39d1830f6
fixed use of reference in pytalloc

The previous code caused memory leaks, and also caused situations
where talloc_free could be called on pointers with multiple parents

The new approach is to have two functions:

  py_talloc_import : steals the pointer, so it becomes wholly owned by
                     the python object
  py_talloc_reference: uses a reference, so it is owned by both python
                     and C
lib/talloc/pytalloc.c
lib/talloc/pytalloc.h