mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r1434) Fix: [ 1098553 ] Crash when all vehicles from a vehicles per station list had been removed
This commit is contained in:
parent
6d502ff715
commit
a4aa201b2f
@ -120,7 +120,7 @@ void BuildVehicleList(vehiclelist_d *vl, int type, int owner, int station)
|
||||
}
|
||||
|
||||
vl->sort_list = realloc(vl->sort_list, n * sizeof(vl->sort_list[0]));
|
||||
if (vl->sort_list == NULL)
|
||||
if (n!=0 && vl->sort_list == NULL)
|
||||
error("Could not allocate memory for the vehicle-sorting-list");
|
||||
vl->list_length = n;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user