mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Fix a segfault when freeing locations.
When chasing linked lists with a double pointer, must check the first dereference and not the pointer itself.
This commit is contained in:
parent
e1226bd3f1
commit
d80a3413e5
1 changed files with 1 additions and 1 deletions
|
@ -133,7 +133,7 @@ defspace_free_loc (defspace_t *space, int ofs, int size)
|
|||
if (ofs < 0 || ofs >= space->size || ofs + size > space->size)
|
||||
internal_error (0, "defspace: freeing bogus location %d:%d",
|
||||
ofs, size);
|
||||
for (l = &space->free_locs; l; l = &(*l)->next) {
|
||||
for (l = &space->free_locs; *l; l = &(*l)->next) {
|
||||
loc = *l;
|
||||
// location to be freed is below the free block
|
||||
// need to create a new free block
|
||||
|
|
Loading…
Reference in a new issue