Commit e697d574 authored by Mark Santaniello's avatar Mark Santaniello Committed by Facebook Github Bot

Fix memory leak in usingJEMalloc()

Summary: We should probably just free this.

Reviewed By: yfeldblum

Differential Revision: D20119718

fbshipit-source-id: 2a6c79730243b7af5ba90dac631ce0c8e1e0e6a4
parent 91aeb986
......@@ -116,12 +116,14 @@ FOLLY_NOINLINE inline bool usingJEMalloc() noexcept {
uint64_t origAllocated = *counter;
static const void* volatile ptr = malloc(1);
static void* volatile ptr = malloc(1);
if (!ptr) {
// wtf, failing to allocate 1 byte
return false;
}
free(ptr);
return (origAllocated != *counter);
}
();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment