diff --git a/deps/ox/src/ox/mc/write.hpp b/deps/ox/src/ox/mc/write.hpp index 8d6de382..a5ab40f1 100644 --- a/deps/ox/src/ox/mc/write.hpp +++ b/deps/ox/src/ox/mc/write.hpp @@ -185,9 +185,9 @@ template for (std::size_t i = 0; i < len; i++) { auto &key = keys[i]; const auto keyLen = ox_strlen(key); - auto wkey = static_cast(ox_alloca(keyLen + 1)); + auto wkey = ox_malloca(keyLen + 1, char, 0); memcpy(wkey, key.c_str(), keyLen + 1); - oxReturnError(writer.field("", SerStr(&wkey, keyLen))); + oxReturnError(writer.field("", SerStr(wkey.get(), keyLen))); oxReturnError(writer.field("", &(*val)[key])); }