From: Byrial Jensen Date: Fri, 16 Dec 2011 01:57:20 +0000 (+0100) Subject: Fix crash when selecting user soundfile due to free() of not malloc()'ed memory X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=ca4e429b35c3b392bce777857c921307eac3b666;p=xboard.git Fix crash when selecting user soundfile due to free() of not malloc()'ed memory --- diff --git a/xoptions.c b/xoptions.c index 648d452..f297ab4 100644 --- a/xoptions.c +++ b/xoptions.c @@ -638,7 +638,7 @@ char *soundNames[] = { char *soundFiles[] = { // sound files corresponding to above names "", "$", - "*", // kludge alert: as first thing in the dialog readout this is replaced with the user-given .WAV filename + NULL, // kludge alert: as first thing in the dialog readout this is replaced with the user-given .WAV filename "honkhonk.wav", "cymbal.wav", "ding1.wav", @@ -1289,7 +1289,7 @@ void SoundOptionsProc(w, event, prms, nprms) String *prms; Cardinal *nprms; { - soundFiles[2] = "*"; + soundFiles[2] = strdup("*"); GenericPopUp(soundOptions, _("Sound Options"), 0); }