From c00aa9985af76062dbc3e80501012a23875f1fdc Mon Sep 17 00:00:00 2001
From: Robert Shearman <R.J.Shearman@warwick.ac.uk>
Date: Tue, 13 May 2003 00:30:10 +0000
Subject: [PATCH] Fix use of freed memory.

---
 dlls/comctl32/listview.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 2b36a966f94..0ba2ceec149 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -7878,10 +7878,11 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr)
   if (infoPtr->hDefaultFont) DeleteObject(infoPtr->hDefaultFont);
   if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush);
 
+  SetWindowLongW(infoPtr->hwndSelf, 0, 0);
+
   /* free listview info pointer*/
   COMCTL32_Free(infoPtr);
 
-  SetWindowLongW(infoPtr->hwndSelf, 0, 0);
   return 0;
 }
 
-- 
GitLab