summaryrefslogtreecommitdiffstats
path: root/src/jemalloc.c
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2012-04-25 20:13:44 (GMT)
committerJason Evans <je@fb.com>2012-04-25 20:13:44 (GMT)
commit3fb50b0407ff7dfe14727995706e2b42836f0f7e (patch)
tree7d05e1bb4d8a01a23dda6247524eb116064b83d5 /src/jemalloc.c
parent6b9ed67b4b9d65731d1eeb7937989ef96288b706 (diff)
downloadjemalloc-3fb50b0407ff7dfe14727995706e2b42836f0f7e.zip
jemalloc-3fb50b0407ff7dfe14727995706e2b42836f0f7e.tar.gz
jemalloc-3fb50b0407ff7dfe14727995706e2b42836f0f7e.tar.bz2
Fix a PROF_ALLOC_PREP() error path.
Fix a PROF_ALLOC_PREP() error path to initialize the return value to NULL.
Diffstat (limited to 'src/jemalloc.c')
-rw-r--r--src/jemalloc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c
index d9fecef..52296e0 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -1384,7 +1384,6 @@ je_allocm(void **ptr, size_t *rsize, size_t size, int flags)
size_t alignment = (ZU(1) << (flags & ALLOCM_LG_ALIGN_MASK)
& (SIZE_T_MAX-1));
bool zero = flags & ALLOCM_ZERO;
- prof_thr_cnt_t *cnt;
assert(ptr != NULL);
assert(size != 0);
@@ -1397,6 +1396,8 @@ je_allocm(void **ptr, size_t *rsize, size_t size, int flags)
goto label_oom;
if (config_prof && opt_prof) {
+ prof_thr_cnt_t *cnt;
+
PROF_ALLOC_PREP(1, usize, cnt);
if (cnt == NULL)
goto label_oom;
@@ -1456,7 +1457,6 @@ je_rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, int flags)
& (SIZE_T_MAX-1));
bool zero = flags & ALLOCM_ZERO;
bool no_move = flags & ALLOCM_NO_MOVE;
- prof_thr_cnt_t *cnt;
assert(ptr != NULL);
assert(*ptr != NULL);
@@ -1466,6 +1466,8 @@ je_rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, int flags)
p = *ptr;
if (config_prof && opt_prof) {
+ prof_thr_cnt_t *cnt;
+
/*
* usize isn't knowable before iralloc() returns when extra is
* non-zero. Therefore, compute its maximum possible value and