fixed memory leak due to allocation inside a function passed tostd::call_once