Module: wine Branch: master Commit: 41044dcd8c2d011a9602e2c342eb9accc818054a URL: http://source.winehq.org/git/wine.git/?a=commit;h=41044dcd8c2d011a9602e2c342...
Author: Michael Stefaniuc mstefani@redhat.de Date: Mon Nov 19 00:20:05 2007 +0100
quartz: Fix memory leaks on error paths. Found by Smatch.
---
dlls/quartz/dsoundrender.c | 4 +++- dlls/quartz/filesource.c | 2 ++ dlls/quartz/parser.c | 8 ++++++-- dlls/quartz/pin.c | 12 +++++++++--- dlls/quartz/transform.c | 4 ++++ dlls/quartz/videorenderer.c | 4 +++- 6 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index a7ebd9f..947bb98 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -97,10 +97,12 @@ static HRESULT DSoundRender_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLE { pPinImpl->pin.lpVtbl = &DSoundRender_InputPin_Vtbl; pPinImpl->lpVtblMemInput = &MemInputPin_Vtbl; - + *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl); return S_OK; } + + CoTaskMemFree(pPinImpl); return E_FAIL; }
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 726776b..73c92b2 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -880,6 +880,8 @@ static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter *ppPin = (IPin *)(&pPinImpl->pin.pin.lpVtbl); return S_OK; } + + CoTaskMemFree(pPinImpl); return E_FAIL; }
diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 39ea58b..94eb614 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -128,10 +128,12 @@ static HRESULT Parser_OutputPin_Construct(const PIN_INFO * pPinInfo, ALLOCATOR_P if (SUCCEEDED(Parser_OutputPin_Init(pPinInfo, props, pUserData, pQueryAccept, pmt, fSamplesPerSec, pCritSec, pPinImpl))) { pPinImpl->pin.pin.lpVtbl = &Parser_OutputPin_Vtbl; - + *ppPin = (IPin *)pPinImpl; return S_OK; } + + CoTaskMemFree(pPinImpl); return E_FAIL; }
@@ -723,10 +725,12 @@ static HRESULT Parser_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLEPROC p if (SUCCEEDED(PullPin_Init(pPinInfo, pSampleProc, pUserData, pQueryAccept, pCritSec, pPinImpl))) { pPinImpl->pin.lpVtbl = &Parser_InputPin_Vtbl; - + *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl); return S_OK; } + + CoTaskMemFree(pPinImpl); return E_FAIL; }
diff --git a/dlls/quartz/pin.c b/dlls/quartz/pin.c index 9960dff..08ddcef 100644 --- a/dlls/quartz/pin.c +++ b/dlls/quartz/pin.c @@ -147,10 +147,12 @@ HRESULT InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLEPROC pSampleProc, LP { pPinImpl->pin.lpVtbl = &InputPin_Vtbl; pPinImpl->lpVtblMemInput = &MemInputPin_Vtbl; - + *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl); return S_OK; } + + CoTaskMemFree(pPinImpl); return E_FAIL; }
@@ -228,10 +230,12 @@ HRESULT OutputPin_Construct(const PIN_INFO * pPinInfo, ALLOCATOR_PROPERTIES *pro if (SUCCEEDED(OutputPin_Init(pPinInfo, props, pUserData, pQueryAccept, pCritSec, pPinImpl))) { pPinImpl->pin.lpVtbl = &OutputPin_Vtbl; - + *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl); return S_OK; } + + CoTaskMemFree(pPinImpl); return E_FAIL; }
@@ -1021,10 +1025,12 @@ HRESULT PullPin_Construct(const PIN_INFO * pPinInfo, SAMPLEPROC pSampleProc, LPV if (SUCCEEDED(PullPin_Init(pPinInfo, pSampleProc, pUserData, pQueryAccept, pCritSec, pPinImpl))) { pPinImpl->pin.lpVtbl = &PullPin_Vtbl; - + *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl); return S_OK; } + + CoTaskMemFree(pPinImpl); return E_FAIL; }
diff --git a/dlls/quartz/transform.c b/dlls/quartz/transform.c index b63cacd..0570a90 100644 --- a/dlls/quartz/transform.c +++ b/dlls/quartz/transform.c @@ -107,6 +107,8 @@ static HRESULT TransformFilter_InputPin_Construct(const PIN_INFO * pPinInfo, SAM *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl); return S_OK; } + + CoTaskMemFree(pPinImpl); return E_FAIL; }
@@ -136,6 +138,8 @@ static HRESULT TransformFilter_OutputPin_Construct(const PIN_INFO * pPinInfo, co *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl); return S_OK; } + + CoTaskMemFree(pPinImpl); return E_FAIL; }
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 9e76fd1..67e601e 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -277,10 +277,12 @@ static HRESULT VideoRenderer_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPL { pPinImpl->pin.lpVtbl = &VideoRenderer_InputPin_Vtbl; pPinImpl->lpVtblMemInput = &MemInputPin_Vtbl; - + *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl); return S_OK; } + + CoTaskMemFree(pPinImpl); return E_FAIL; }