[MSVIDEO] Fix installable driver removal

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[MSVIDEO] Fix installable driver removal

Christian Costa
Hi,

The current code frees the driver that follows the one we want to remove.

Changelog:
Fix installable driver removal.

Christian Costa   [hidden email]


Index: dlls/msvideo/msvideo_main.c
===================================================================
RCS file: /home/wine/wine/dlls/msvideo/msvideo_main.c,v
retrieving revision 1.66
diff -u -r1.66 msvideo_main.c
--- dlls/msvideo/msvideo_main.c 22 Aug 2005 09:19:16 -0000 1.66
+++ dlls/msvideo/msvideo_main.c 14 Oct 2005 21:53:16 -0000
@@ -259,7 +259,7 @@
    reg_driver_list = driver;
     
    return TRUE;
- oom:
+oom:
    HeapFree(GetProcessHeap(), 0, driver);
    return FALSE;
 }
@@ -270,7 +270,8 @@
 BOOL VFWAPI ICRemove(DWORD fccType, DWORD fccHandler, UINT wFlags)
 {
     reg_driver** pdriver;
-    
+    reg_driver*  drv;
+
     TRACE("(%s,%s,0x%08x)\n", wine_dbgstr_fcc(fccType), wine_dbgstr_fcc(fccHandler), wFlags);
 
     /* Check if a driver is already registered */
@@ -284,9 +285,10 @@
         return FALSE;
 
     /* Remove the driver from the list */
+    drv = *pdriver;
     *pdriver = (*pdriver)->next;
-    HeapFree(GetProcessHeap(), 0, (*pdriver)->name);
-    HeapFree(GetProcessHeap(), 0, *pdriver);
+    HeapFree(GetProcessHeap(), 0, drv->name);
+    HeapFree(GetProcessHeap(), 0, drv);
     
     return TRUE;  
 }