[PATCH 1/7] wmp: Handle allocation failure in IWMPMedia_get_sourceURL
Anton Romanov
theli.ua at gmail.com
Mon Mar 12 23:34:49 CDT 2018
Signed-off-by: Anton Romanov <theli.ua at gmail.com>
---
dlls/wmp/player.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/wmp/player.c b/dlls/wmp/player.c
index 6c68240fa8..987d189515 100644
--- a/dlls/wmp/player.c
+++ b/dlls/wmp/player.c
@@ -1577,9 +1577,14 @@ static HRESULT WINAPI WMPMedia_get_isIdentical(IWMPMedia *iface, IWMPMedia *othe
static HRESULT WINAPI WMPMedia_get_sourceURL(IWMPMedia *iface, BSTR *pbstrSourceUrl)
{
WMPMedia *This = impl_from_IWMPMedia(iface);
+ BSTR url;
TRACE("(%p)->(%p)\n", This, pbstrSourceUrl);
- *pbstrSourceUrl = SysAllocString(This->url);
- return S_OK;
+ url = SysAllocString(This->url);
+ if (url) {
+ *pbstrSourceUrl = url;
+ return S_OK;
+ }
+ return E_FAIL;
}
static HRESULT WINAPI WMPMedia_get_name(IWMPMedia *iface, BSTR *pbstrName)
--
2.16.2
More information about the wine-devel
mailing list