shithub: choc

Download patch

ref: 6a500c42694e05d7c849fecdf2c9cd705ed3c1ae
parent: ce7f7c8f4ff189d21b6d9f9cb6b1c987740414e8
author: Turo Lamminen <turotl@gmail.com>
date: Sat Jul 21 12:20:37 EDT 2018

d_iwad: One path through D_TryFindWADByName creates a new string so all paths must

Otherwise the caller won't know whether it should free the string

--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -773,7 +773,7 @@
 //
 // D_TryWADByName
 //
-// Searches for a WAD by its filename, or passes through the filename
+// Searches for a WAD by its filename, or returns a copy of the filename
 // if not found.
 //
 
@@ -789,7 +789,7 @@
     }
     else
     {
-        return filename;
+        return M_StringDuplicate(filename);
     }
 }