summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2012-05-15 20:53:21 (GMT)
committerJason Evans <je@fb.com>2012-05-15 20:56:28 (GMT)
commit3860eac17023933180ef5dfb5bd24077cda57dfe (patch)
tree8d82d2e791953f636ce4db268bd37c39bf5e366b /include
parentcbb71caceb1e53d0fd21284ce298885327c211b4 (diff)
downloadjemalloc-3860eac17023933180ef5dfb5bd24077cda57dfe.zip
jemalloc-3860eac17023933180ef5dfb5bd24077cda57dfe.tar.gz
jemalloc-3860eac17023933180ef5dfb5bd24077cda57dfe.tar.bz2
Fix heap profiling crash for realloc(p, 0) case.
Fix prof_realloc() to not call prof_ctx_set() if a sampled object is being freed via realloc(p, 0).
Diffstat (limited to 'include')
-rw-r--r--include/jemalloc/internal/prof.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/jemalloc/internal/prof.h b/include/jemalloc/internal/prof.h
index c3e3f9e..6bed90b 100644
--- a/include/jemalloc/internal/prof.h
+++ b/include/jemalloc/internal/prof.h
@@ -506,7 +506,7 @@ prof_realloc(const void *ptr, size_t size, prof_thr_cnt_t *cnt,
if ((uintptr_t)cnt > (uintptr_t)1U) {
prof_ctx_set(ptr, cnt->ctx);
cnt->epoch++;
- } else
+ } else if (ptr != NULL)
prof_ctx_set(ptr, (prof_ctx_t *)(uintptr_t)1U);
/*********/
mb_write();