From ca4e429b35c3b392bce777857c921307eac3b666 Mon Sep 17 00:00:00 2001 From: Byrial Jensen Date: Fri, 16 Dec 2011 02:57:20 +0100 Subject: [PATCH] Fix crash when selecting user soundfile due to free() of not malloc()'ed memory --- xoptions.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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); } -- 1.7.0.4