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
|
@ -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…
Reference in New Issue
Block a user