1. if some idot send in iPface is NULL to DirectDrawCreate/DirectDrawCreateEx (example DirectDrawCreate/DirectDrawCreateEx(NULL,NULL,NULL)) we do not free the alloc memory at fail.
svn path=/trunk/; revision=25194
if (This == NULL)
{
- /* We do not have any DirectDraw interface alloc */
- This = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
+ LPDDRAWI_DIRECTDRAW_INT memThis;
+
+ /* We do not have any DirectDraw interface alloc
+ * or a idot send in pIface as NULL
+ */
+ memThis = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
+ This = memThis;
if (This == NULL)
{
+ if (memThis != NULL)
+ {
+ /* do not create memmory leak if some
+ * idot send in pIface as NULL
+ */
+ DxHeapMemFree(memThis);
+ }
return DDERR_OUTOFMEMORY;
}
}