Author: gadamopoulos
Date: Sun Oct 28 17:31:33 2012
New Revision: 57642
URL:
http://svn.reactos.org/svn/reactos?rev=57642&view=rev
Log:
[win32k]
- Plug some object leaks in callproc and clipboard code
Modified:
trunk/reactos/win32ss/user/ntuser/callproc.c
trunk/reactos/win32ss/user/ntuser/clipboard.c
Modified: trunk/reactos/win32ss/user/ntuser/callproc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/callpr…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/callproc.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/callproc.c [iso-8859-1] Sun Oct 28 17:31:33 2012
@@ -45,6 +45,9 @@
NewCallProc->wType |= Unicode ? UserGetCPDA2U : UserGetCPDU2A ;
NewCallProc->spcpdNext = NULL;
}
+
+ /* Release the extra reference (UserCreateObject added 2 references) */
+ UserDereferenceObject(NewCallProc);
return NewCallProc;
}
Modified: trunk/reactos/win32ss/user/ntuser/clipboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/clipbo…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/clipboard.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/clipboard.c [iso-8859-1] Sun Oct 28 17:31:33 2012
@@ -211,6 +211,9 @@
/* Add the clipboard data */
IntAddFormatedData(pWinStaObj, CF_DIB, hMem, TRUE, TRUE);
+ /* Release the extra reference (UserCreateObject added 2 references) */
+ UserDereferenceObject(pClipboardData);
+
cleanup:
UserReleaseDC(NULL, hdc, FALSE);
}
@@ -302,6 +305,9 @@
*((LCID*)pMemObj->Data) = NtCurrentTeb()->CurrentLocale;
IntAddFormatedData(pWinStaObj, CF_LOCALE, hMem, TRUE, TRUE);
}
+
+ /* Release the extra reference (UserCreateObject added 2 references) */
+ UserDereferenceObject(pMemObj);
}
/* Add CF_TEXT. Note: it is synthesized in user32.dll */
@@ -1099,6 +1105,9 @@
}
_SEH2_END;
+ /* Release the extra reference (UserCreateObject added 2 references) */
+ UserDereferenceObject(pMemObj);
+
/* If we failed to copy data, remove handle */
if (!pMemObj)
{