From 1bc72dce5f8bc40e369e69b684816fdaaa07da43 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 10 Mar 2006 08:03:24 +0000 Subject: [PATCH] Coverity #857: Fix resource leak in error path by freeing earlier. --- ChangeLog | 5 +++++ hw/xfree86/int10/generic.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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);