mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: fix memory leak in netchan
frag_message_buf wasn't always freed alongside with fragbuf_t instead of ensuring frag_message_buf being freed, I turned it into a flexible array member
This commit is contained in:
@@ -184,13 +184,13 @@ typedef struct fragbuf_s
|
||||
struct fragbuf_s *next; // next buffer in chain
|
||||
int bufferid; // id of this buffer
|
||||
sizebuf_t frag_message; // message buffer where raw data is stored
|
||||
byte *frag_message_buf; // the actual data sits here
|
||||
qboolean isfile; // is this a file buffer?
|
||||
qboolean isbuffer; // is this file buffer from memory ( custom decal, etc. ).
|
||||
qboolean iscompressed; // is compressed file, we should using filename.ztmp
|
||||
char filename[MAX_OSPATH]; // name of the file to save out on remote host
|
||||
int foffset; // offset in file from which to read data
|
||||
int size; // size of data to read at that offset
|
||||
byte frag_message_buf[1]; // the actual data sits here (flexible)
|
||||
} fragbuf_t;
|
||||
|
||||
// Waiting list of fragbuf chains
|
||||
|
||||
Reference in New Issue
Block a user