diff --git a/ChangeLog b/ChangeLog index 67c3c68a4..883a9f2ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-09 Eric Anholt + + * hw/xfree86/int10/generic.c: (xf86ExtendedInitInt10): + Coverity #857: Fix resource leak in error path by freeing earlier. + 2006-03-09 Eric Anholt * hw/xfree86/parser/Keyboard.c: (xf86parseKeyboardSection): diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c index a9ceebcb0..69596d48e 100644 --- a/hw/xfree86/int10/generic.c +++ b/hw/xfree86/int10/generic.c @@ -232,6 +232,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) } else location_type = pEnt->location.type; + xfree(pEnt); + switch (location_type) { case BUS_PCI: vbiosMem = (unsigned char *)base + bios_location; @@ -263,7 +265,6 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) default: goto error1; } - xfree(pEnt); pInt->BIOSseg = V_BIOS >> 4; pInt->num = 0xe6; LockLegacyVGA(pInt, &vga);