Fixed linux listenserver startup problems

Fixed multiple buffer overruns and memory leaks.
This commit is contained in:
jeefo 2020-11-23 00:06:18 +03:00
commit 74f1ab866b
29 changed files with 371 additions and 254 deletions

View file

@ -180,8 +180,8 @@ private:
FreeFunction freeFun_ = nullptr;
public:
inline MemFileStorage () = default;
inline ~MemFileStorage () = default;
explicit MemFileStorage () = default;
~MemFileStorage () = default;
public:
void initizalize (LoadFunction loader, FreeFunction unloader) {
@ -212,14 +212,14 @@ public:
return nullptr;
}
*size = static_cast <int> (file.length ());
auto data = alloc.allocate <uint8> (*size);
auto data = Memory::get <uint8> (*size);
file.read (data, *size);
return data;
}
static void defaultUnload (void *buffer) {
alloc.deallocate (buffer);
Memory::release (buffer);
}
static String loadToString (StringRef filename) {