From 032a1821a872bbed991e27cc28cb4dc56e6947b5 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 22 Jun 1999 19:05:48 +0000 Subject: [PATCH] Fixed memory leak in mci structures. --- multimedia/mci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multimedia/mci.c b/multimedia/mci.c index 0666b4cf55e..3ccae8da6ca 100644 --- a/multimedia/mci.c +++ b/multimedia/mci.c @@ -1161,8 +1161,9 @@ DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms) /* FIXME is there any memory leak here ? */ MCI_GetOpenDrv(wDevID)->lpstrAlias = strdup(lpParms->lpstrAlias); /* mplayer does allocate alias to CDAUDIO */ - } else + } else { MCI_GetOpenDrv(wDevID)->lpstrAlias = NULL; + } if (dwParam & MCI_OPEN_TYPE) { if (dwParam & MCI_OPEN_TYPE_ID) { #if 0 @@ -1261,6 +1262,7 @@ DWORD MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) } MCI_GetDrv(wDevID)->modp.wType = 0; free(MCI_GetDrv(wDevID)->mop.lpstrDeviceType); + free(MCI_GetDrv(wDevID)->mop.lpstrAlias); if (dwParam & MCI_NOTIFY) mciDriverNotify16(lpParms->dwCallback, wDevID,