1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-22 16:23:49 +03:00

r6033: Patch from 'lifeless' to clarify behaviour with NULL pointers.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett
2005-03-24 08:00:15 +00:00
committed by Gerald (Jerry) Carter
parent c324d97413
commit 48c5187967
2 changed files with 3 additions and 1 deletions

View File

@@ -609,7 +609,8 @@ void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *n
/*
move a lump of memory from one talloc context to another return the
ptr on success, or NULL if it could not be transferred
ptr on success, or NULL if it could not be transferred.
passing NULL as ptr will always return NULL with no side effects.
*/
void *talloc_steal(const void *new_ctx, const void *ptr)
{

View File

@@ -306,6 +306,7 @@ NOTE: It is possible to produce loops in the parent/child relationship
if you are not careful with talloc_steal(). No guarantees are provided
as to your sanity or the safety of your data if you do this.
talloc_steal (new_ctx, NULL) will return NULL with no sideeffects.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
off_t talloc_total_size(const void *ptr);