We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2004

Summary: Calling Mix_Quit twice with midi support leads to segfault
Product: SDL_mixer Reporter: Martin Gerhardy <martin.gerhardy>
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: All   
OS: All   

Description Martin Gerhardy 2013-08-01 04:10:24 UTC
the variable soundfont_paths is freed, but not set to NULL. So calling Mix_Quit a second time would crash if SDL_mixer is compiled with midi support. For all the other sound types, it's guarded with if (initialized). So i think it would be good to fix this by setting the soundfont_paths variable to NULL in line 231 of mixer.c


diff -r d4f0ea99a069 mixer.c
--- a/mixer.c	Wed Jul 31 21:45:53 2013 -0700
+++ b/mixer.c	Thu Aug 01 10:08:43 2013 +0200
@@ -243,6 +243,7 @@
 #ifdef MID_MUSIC
     if (soundfont_paths) {
         SDL_free(soundfont_paths);
+        soundfont_paths = NULL;
     }
 #endif
     initialized = 0;
Comment 1 Sam Lantinga 2013-08-01 04:39:09 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL_mixer/rev/bbc63f965931