pytalloc: fixed py_talloc_steal()
authorAndrew Tridgell <tridge@samba.org>
Wed, 25 Aug 2010 04:29:59 +0000 (14:29 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 25 Aug 2010 13:05:05 +0000 (23:05 +1000)
commit634e06e465be7a8921cb95884ec427f48bf812da
treea7e4fac46b60b4ed47a5d0081cfbd5105273acff
parent9218de4b740427a5f381be59ab00a21b0690fb9e
pytalloc: fixed py_talloc_steal()

py_talloc_steal() was implemented as a macro which evaluated it's 2nd
argument twice. It was often called via a macro with a 2nd argument
that was a function call, for example an allocation in
py_talloc_new(). This meant it allocated memory twice, and leaked one
of them.

This re-implements py_talloc_steal() as a function, so that it only
does the allocation once.
lib/talloc/pytalloc.c
lib/talloc/pytalloc.h