diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-07-18 04:54:31 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-07-18 04:54:31 +0930 |
commit | 4f331872bc783445c709e5fe4846b8687e274953 (patch) | |
tree | 01730b205abad309b3aabc6b466a1992bdefe957 /lib/talloc/talloc.h | |
parent | 8893215aaf714154c190c66bf7d1ce568118ec39 (diff) | |
download | samba-4f331872bc783445c709e5fe4846b8687e274953.tar.gz samba-4f331872bc783445c709e5fe4846b8687e274953.tar.bz2 samba-4f331872bc783445c709e5fe4846b8687e274953.zip |
talloc: don't allow a talloc_pool inside a talloc_pool.
We explicitly call free() on a pool which falls to zero, assuming it's
not inside another pool (we crash). Check on creation and explicitly
document this case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/talloc/talloc.h')
-rw-r--r-- | lib/talloc/talloc.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h index 05e6292405..e48dc09a40 100644 --- a/lib/talloc/talloc.h +++ b/lib/talloc/talloc.h @@ -839,7 +839,8 @@ void *talloc_find_parent_bytype(const void *ptr, #type); * talloc pool to a talloc parent outside the pool, the whole pool memory is * not free(3)'ed until that moved chunk is also talloc_free()ed. * - * @param[in] context The talloc context to hang the result off. + * @param[in] context The talloc context to hang the result off (must not + * be another pool). * * @param[in] size Size of the talloc pool. * |