]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Reset tempstringsbuf when progs are reset. Fixes possible memory leak in CSQC(?)
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 30 Jun 2020 19:21:50 +0000 (19:21 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 30 Jun 2020 19:21:50 +0000 (19:21 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12765 d7cf8633-e32d-0410-b094-e92efae38249

prvm_edict.c

index 2720c2b94c0e88fc751fdbab02055bbc77abb968..9a14bef9a208795c3646cc396a44c72e5cee76d8 100644 (file)
@@ -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);