Fix use-after-free when loading addons after searching addons

This commit is contained in:
Gustaf Alhäll authored and Alug committed 2025-04-21 12:21:09 +02:00
1 parent 20537807e1
commit b7a5d715c0
1 file changed
+4
+4
View File
@@ -661,6 +661,10 @@ boolean preparefilemenu(boolean samedepth, boolean replayhut)
return false;
}
if (dirmenu != coredirmenu)
Z_Free(dirmenu);
dirmenu = NULL;
for (; sizecoredirmenu > 0; sizecoredirmenu--) // clear out existing items
{
Z_Free(coredirmenu[sizecoredirmenu-1]);