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:
atlaua 2011-09-29 18:54:32 +02:00
parent 3ecb2ee39b
commit 946a492745

View File

@ -1104,8 +1104,6 @@ int confirm_ui(pixel *vid_buf, char *top, char *msg, char *btn)
break;
}
free(msg);
while (!sdl_poll())
{
b = SDL_GetMouseState(&mx, &my);
@ -5569,6 +5567,8 @@ int save_filename_ui(pixel *vid_buf)
}
fclose(f);
free(filename);
}
}