From b808f7f4f5e1e5c8e3d92871b6ee81bb25f673f9 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Tue, 30 Jun 2020 19:21:50 +0000 Subject: [PATCH] Reset tempstringsbuf when progs are reset. Fixes possible memory leak in CSQC(?) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12765 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_edict.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prvm_edict.c b/prvm_edict.c index 2720c2b9..9a14bef9 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -1858,6 +1858,9 @@ void PRVM_Prog_Reset(prvm_prog_t *prog) { if (prog->loaded) { + if(prog->tempstringsbuf.cursize) + Mem_Free(prog->tempstringsbuf.data); + prog->tempstringsbuf.cursize = 0; PRVM_LeakTest(prog); prog->reset_cmd(prog); Mem_FreePool(&prog->progs_mempool); -- 2.39.2