From: Jeremy Allison Date: Tue, 27 Aug 2013 19:43:50 +0000 (-0700) Subject: Remove magic TC_HDR_SIZE handling inside talloc_memlimit_check(). X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=0a0314d160ae8e316e8a64975b6b9f12ec07a60f Remove magic TC_HDR_SIZE handling inside talloc_memlimit_check(). Callers already account for TC_HDR_SIZE, do not add it twice. Signed-off-by: Jeremy Allison Reviewed-by: Simo Sorce (cherry picked from commit 7a6beae68ee3f9a97e9e56f4e24a437839fb3e19) --- diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c index 067d46f97d31..7b827ca0c15c 100644 --- a/lib/talloc/talloc.c +++ b/lib/talloc/talloc.c @@ -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; } }