From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.networking.hostname/hostname.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/windows.networking.hostname/hostname.c b/dlls/windows.networking.hostname/hostname.c index 6f0d3fb9032..b77186af212 100644 --- a/dlls/windows.networking.hostname/hostname.c +++ b/dlls/windows.networking.hostname/hostname.c @@ -254,6 +254,7 @@ DEFINE_IINSPECTABLE( hostname_factory, IHostNameFactory, struct hostname_statics static HRESULT WINAPI hostname_factory_CreateHostName( IHostNameFactory *iface, HSTRING name, IHostName **value ) { struct hostname *impl; + HRESULT hr;
TRACE( "iface %p, name %s, value %p\n", iface, debugstr_hstring(name), value );
@@ -263,7 +264,11 @@ static HRESULT WINAPI hostname_factory_CreateHostName( IHostNameFactory *iface,
impl->IHostName_iface.lpVtbl = &hostname_vtbl; impl->ref = 1; - WindowsDuplicateString( name, &impl->raw_name ); + if (FAILED(hr = WindowsDuplicateString( name, &impl->raw_name ))) + { + free( impl ); + return hr; + }
*value = &impl->IHostName_iface; TRACE( "created IHostName %p.\n", *value );
This merge request was approved by Rémi Bernon.