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:25:47 +02:00
1 parent af544e4e16
commit f398c0ceea
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]);