[PATCH] mshmtl: Check nsrange before calling ->Release (coverity)

Marcus Meissner marcus at jet.franken.de
Sun Sep 20 11:43:24 CDT 2009


Hi,

nsrange might be valid NULL here, so calling Release would crash.

Ciao, Marcus
---
 dlls/mshtml/selection.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/mshtml/selection.c b/dlls/mshtml/selection.c
index 65e3ecb..f1909be 100644
--- a/dlls/mshtml/selection.c
+++ b/dlls/mshtml/selection.c
@@ -182,7 +182,7 @@ static HRESULT WINAPI HTMLSelectionObject_createRange(IHTMLSelectionObject *ifac
 
     hres = HTMLTxtRange_Create(This->doc, nsrange, &range_obj);
 
-    nsIDOMRange_Release(nsrange);
+    if (nsrange) nsIDOMRange_Release(nsrange);
     *range = (IDispatch*)range_obj;
     return hres;
 }
-- 
1.5.6



More information about the wine-patches mailing list