Bugfix: Fixed a segmentation fault in confirm_ui()
confirm_ui() free()ed its msg. This resulted in attemps to free const strings or and to invalid memoory accesses (because some other functions wanted to reuse the parameter which they gave to confirm_ui() after calling this function). Resolved by removing the call to free() from confirm_ui() and adding it after the calls to confirm_ui(9, if necessary.
This commit is contained in:
parent
3ecb2ee39b
commit
946a492745
@ -1104,8 +1104,6 @@ int confirm_ui(pixel *vid_buf, char *top, char *msg, char *btn)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(msg);
|
|
||||||
|
|
||||||
while (!sdl_poll())
|
while (!sdl_poll())
|
||||||
{
|
{
|
||||||
b = SDL_GetMouseState(&mx, &my);
|
b = SDL_GetMouseState(&mx, &my);
|
||||||
@ -5569,6 +5567,8 @@ int save_filename_ui(pixel *vid_buf)
|
|||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
|
free(filename);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user