summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-08-27 12:59:04 -0700
committerKarolin Seeger <kseeger@samba.org>2015-03-15 22:14:07 +0100
commit2435334409d441e502535aa4b353cd7ef9174cf2 (patch)
tree24335ec421d5e1545526eedda4a788b49d992336
parent378363f0c81fc3bf88fd2b4805ac59e3ccaaecdd (diff)
downloadsamba-2435334409d441e502535aa4b353cd7ef9174cf2.tar.gz
Fix a conditional check. (size - tc->size > 0) is always true if size and tc->size are unsigned.
Replace with (size > tc->size). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> (cherry picked from commit 0fbcfcc824e474874c15d7c0b2ea0df408448906)
-rw-r--r--lib/talloc/talloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index 54f3c0a56d3..2683ff074e9 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -1507,7 +1507,7 @@ _PUBLIC_ void *_talloc_realloc(const void *context, void *ptr, size_t size, cons
return NULL;
}
- if (tc->limit && (size - tc->size > 0)) {
+ if (tc->limit && (size > tc->size)) {
if (!talloc_memlimit_check(tc->limit, (size - tc->size))) {
errno = ENOMEM;
return NULL;