summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-08-27 12:59:04 -0700
committerJeremy Allison <jra@samba.org>2013-08-27 15:44:20 -0700
commit0fbcfcc824e474874c15d7c0b2ea0df408448906 (patch)
treec6e78bef03792c1ad93d6f9341e57debbb7cbf9c
parent43860293225d14ca2c339277b42f8705322463ab (diff)
downloadsamba-0fbcfcc824e474874c15d7c0b2ea0df408448906.tar.gz
samba-0fbcfcc824e474874c15d7c0b2ea0df408448906.tar.bz2
samba-0fbcfcc824e474874c15d7c0b2ea0df408448906.zip
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>
-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 54f3c0a56d..2683ff074e 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;