On Thursday 08 August 2013 19:13:24 Manuel A. Fernandez Montecelo wrote:
> I meant to modify the first patch bug-715461-soundfont_paths.patch so
> when that variable "soundfont_paths" is assigned, it's done with
> SDL_strdup() (it's done in several places in the code --that's where I
> got the idea from--, so "it fits"), and remove the second patch
> altogether, bug-718129-rm-bad-free.patch.

Understood.

> The variable can be set by users of the library to use dynamic memory
> [1], so removing that SDL_free() is theoretically incorrect -- if it
> gets assigned other content in runtime, it would not free it where the
> SDL_free() is removed (which is the end of the program, so actually it
> shoudn't be that important, bug e.g. valgrind would report it as a
> leak).

I think "soundfont_paths" initialisation should be done in Mix_Init().

Otherwise a sequence of Mix_Init, Mix_Quit, Mix_Init and Mix_Quit will lead to 
a segfault. This sequence may not make sense from a user's point of view, but 
it may happen in test suites like SDL-perl's test suite.

> And Dominique, sorry that I didn't catch this when you asked me, I was
> busy at work and couldn't pay full attention to the issue.

Don't worry about it. Been there, done that ;-)

All the best

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to