Remove magic TC_HDR_SIZE handling inside talloc_memlimit_check().
authorJeremy Allison <jra@samba.org>
Tue, 27 Aug 2013 19:43:50 +0000 (12:43 -0700)
committerStefan Metzmacher <metze@samba.org>
Tue, 10 Mar 2015 09:55:36 +0000 (10:55 +0100)
Callers already account for TC_HDR_SIZE, do not add it twice.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit 7a6beae68ee3f9a97e9e56f4e24a437839fb3e19)

lib/talloc/talloc.c

index 067d46f97d3100c2bc3fe53fc4f624166d2650c7..7b827ca0c15cb3ddb685a6bd3fab8eb54dd844d1 100644 (file)
@@ -2561,7 +2561,7 @@ static bool talloc_memlimit_check(struct talloc_memlimit *limit, size_t size)
        for (l = limit; l != NULL; l = l->upper) {
                if (l->max_size != 0 &&
                    ((l->max_size <= l->cur_size) ||
-                    (l->max_size - l->cur_size < TC_HDR_SIZE+size))) {
+                    (l->max_size - l->cur_size < size))) {
                        return false;
                }
        }