summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-06-26 08:18:42 +0000
committerAndrew Tridgell <tridge@samba.org>2000-06-26 08:18:42 +0000
commitbdb98d93f2dcc47fcc713ce54c111f387572691d (patch)
treea558f1eef99587fbd4633a3b40957b7b3587d406 /source3
parentec1c58fcc0dc19138fe04533484b8acffef2cf0f (diff)
downloadsamba-bdb98d93f2dcc47fcc713ce54c111f387572691d.tar.gz
samba-bdb98d93f2dcc47fcc713ce54c111f387572691d.tar.xz
samba-bdb98d93f2dcc47fcc713ce54c111f387572691d.zip
fixed size alignment in talloc
(This used to be commit 064cdb7ee69bff3af12d1e0b3c3b59207c594681)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/talloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/talloc.c b/source3/lib/talloc.c
index 9ba793092d..35d4ddd211 100644
--- a/source3/lib/talloc.c
+++ b/source3/lib/talloc.c
@@ -56,11 +56,11 @@ void *talloc(TALLOC_CTX *t, size_t size)
{
void *p;
- size = (size + TALLOC_ALIGN) & (~TALLOC_ALIGN-1);
+ size = (size + (TALLOC_ALIGN-1)) & ~(TALLOC_ALIGN-1);
if (!t->list || (t->list->total_size - t->list->alloc_size) < size) {
struct talloc_chunk *c;
- size_t asize = (size + TALLOC_CHUNK_SIZE) & ~(TALLOC_CHUNK_SIZE-1);
+ size_t asize = (size + (TALLOC_CHUNK_SIZE-1)) & ~(TALLOC_CHUNK_SIZE-1);
c = (struct talloc_chunk *)malloc(sizeof(*c));
if (!c) return NULL;