From 25b4d6be68f84c9810c79e932e5f5543e373894f Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 27 Feb 2015 17:31:48 +0100 Subject: [PATCH] mshtml: Use return_nsstr helper in IHTMLDocument5::get_compatMode. --- dlls/mshtml/htmldoc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index a9ef3d9563f..977e2cb0534 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -2882,7 +2882,7 @@ static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR * { HTMLDocument *This = impl_from_IHTMLDocument5(iface); nsAString mode_str; - const PRUnichar *mode; + nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -2892,13 +2892,8 @@ static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR * } nsAString_Init(&mode_str, NULL); - nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str); - - nsAString_GetData(&mode_str, &mode); - *p = SysAllocString(mode); - nsAString_Finish(&mode_str); - - return S_OK; + nsres = nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str); + return return_nsstr(nsres, &mode_str, p); } static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {