From 50c5ee82e5c16967f3fc6575f0b1f623b53f3d15 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Sun, 6 Jul 2008 06:13:56 +0000 Subject: [PATCH] From: Jeff Shanholtz [mailto:jpublic@shanholtz.com] Sent: Thursday, July 03, 2008 9:16 AM To: submit@mamedev.org Subject: fix for output.c unregister_client crash My app is causing mame to crash when it unregisters itself as an output client. Output.c's unregister_client() is guaranteed to crash because if it finds a match then it ends up doing a "->next" twice -- once in the "if" body, and once in the "for" statement. This patch to 0.125u8 fixes this problem. It simply adds a "break" to the "if" body since at that point there is no need to continue. Hope this can make it in for 0.126. --- src/osd/windows/output.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osd/windows/output.c b/src/osd/windows/output.c index 57ca8161db3..ca52b8d1e5d 100644 --- a/src/osd/windows/output.c +++ b/src/osd/windows/output.c @@ -251,6 +251,7 @@ static LRESULT unregister_client(HWND hwnd, LPARAM id) *client = (*client)->next; free(temp); found = TRUE; + break; } // return an error if not found