Coverity #806: Another memory leak on OOM path.

This commit is contained in:
Adam Jackson 2006-04-14 23:38:11 +00:00
parent 1b04e31392
commit d61219aaad
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2006-04-14 Adam Jackson <ajax@freedesktop.org>
* mi/micmap.c:
Coverity #806: Another memory leak on OOM path.
2006-04-14 Adam Jackson <ajax@freedesktop.org> 2006-04-14 Adam Jackson <ajax@freedesktop.org>
* hw/xfree86/common/xf86Helper.c: * hw/xfree86/common/xf86Helper.c:

View File

@ -587,9 +587,11 @@ miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
if (nvtype) if (nvtype)
{ {
vid = (VisualID *) xalloc (nvtype * sizeof (VisualID)); vid = (VisualID *) xalloc (nvtype * sizeof (VisualID));
if (!vid) if (!vid) {
xfree(preferredCVCs);
return FALSE; return FALSE;
} }
}
depth->depth = d; depth->depth = d;
depth->numVids = nvtype; depth->numVids = nvtype;
depth->vids = vid; depth->vids = vid;