Peter Åstrand wrote:


1) I believe the mciwave.c patch below makes sense in any case, right?

   Without it freed memory is used.


I don't see why ?


wmw->openParms.lpstrElementName and filename is a pointer to the same memory, due to this statement in WAVE_mciOpen:

memcpy(&wmw->openParms, lpOpenParms, sizeof(MCI_WAVE_OPEN_PARMSA));

actually not exactly as mciOpenFile is called with lpOpenParms->lpstrElementName

but you're right that the code is wrong, as we're freeing the lpstrElementName as passed by the calling program the right fix would be to set wmw->openParms.lpstrElementName to NULL after memcpy:ing lpOpenParams in mciOpen

A+


Reply via email to