mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-04-26 23:00:44 +02:00
hw/xwin: Fix a memory leak in error path in winInitWM()
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This commit is contained in:
parent
98cde254ac
commit
cc7dedd6b5
1 changed files with 7 additions and 5 deletions
|
|
@ -1201,11 +1201,13 @@ winInitWM (void **ppWMInfo,
|
|||
XMsgProcArgPtr pXMsgArg = (XMsgProcArgPtr) malloc (sizeof(XMsgProcArgRec));
|
||||
|
||||
/* Bail if the input parameters are bad */
|
||||
if (pArg == NULL || pWMInfo == NULL)
|
||||
{
|
||||
ErrorF ("winInitWM - malloc failed.\n");
|
||||
return FALSE;
|
||||
}
|
||||
if (pArg == NULL || pWMInfo == NULL || pXMsgArg == NULL) {
|
||||
ErrorF ("winInitWM - malloc failed.\n");
|
||||
free(pArg);
|
||||
free(pWMInfo);
|
||||
free(pXMsgArg);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Zero the allocated memory */
|
||||
ZeroMemory (pArg, sizeof (WMProcArgRec));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue