Fix io.open() crashing the client sometimes

This commit is contained in:
LJ Sonic 2024-12-30 00:03:41 +01:00
parent 28d5b79fa5
commit 91d1c11617

View file

@ -606,7 +606,7 @@ void AddLuaFileTransfer(const char *filename, const char *mode)
prevnext = &((*prevnext)->next);
// Allocate file transfer information and append it to the transfer list
filetransfer = malloc(sizeof(luafiletransfer_t));
filetransfer = calloc(1, sizeof(luafiletransfer_t));
if (!filetransfer)
I_Error("AddLuaFileTransfer: Out of memory\n");
*prevnext = filetransfer;