lib: talloc: Make it clear that talloc_get_size(NULL) returns 0.
authorJeremy Allison <jra@samba.org>
Wed, 11 Jan 2017 19:48:25 +0000 (11:48 -0800)
committerStefan Metzmacher <metze@samba.org>
Thu, 12 Jan 2017 18:23:25 +0000 (19:23 +0100)
This *isn't* a behavior change, as the previous code could potentially
return the size of null_context, which (currently) is defined as
a named talloc region of ZERO size, but this makes it very clear
what the ABI behavior should be.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 12 19:23:25 CET 2017 on sn-devel-144

lib/talloc/talloc.c

index 279021c137a65151d92d9df14fe9e4abcf8502a1..8bdd4b6653a72bb4b22ed74196c9f1bc5ca06941 100644 (file)
@@ -2738,9 +2738,6 @@ _PUBLIC_ size_t talloc_get_size(const void *context)
 {
        struct talloc_chunk *tc;
 
-       if (context == NULL) {
-               context = null_context;
-       }
        if (context == NULL) {
                return 0;
        }