Fixing crash when joinging game over UDP Netlist: when exiting the menu for any reason, return 0 instead of following the code and possibly lead to drawing text from a newly free'd pointer - D'OH

This commit is contained in:
zicodxx 2010-07-21 16:58:38 +00:00
parent 5c2fdc5063
commit b41faef1d3
2 changed files with 7 additions and 2 deletions

View file

@ -1,5 +1,9 @@
D1X-Rebirth Changelog
20100721
--------
main/net_udp.c: Fixing crash when joinging game over UDP Netlist: when exiting the menu for any reason, return 0 instead of following the code and possibly lead to drawing text from a newly free'd pointer - D'OH!
20100720
--------
main/net_udp.c: Thanks to Marix for hinting me I should not init a pointer with quotes if I plan to allocate/free it... my stupid-level officially broke the record

View file

@ -580,6 +580,7 @@ int net_udp_list_join_poll( newmenu *menu, d_event *event, direct_join *dj )
break;
}
case EVENT_WINDOW_CLOSE:
{
d_free(ljtext);
d_free(menus);
d_free(dj);
@ -588,8 +589,8 @@ int net_udp_list_join_poll( newmenu *menu, d_event *event, direct_join *dj )
net_udp_close();
Network_status = NETSTAT_MENU; // they cancelled
}
break;
return 0;
}
default:
break;
}