From: Vibhav Pant vibhavp@gmail.com
--- dlls/cfgmgr32/main.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/dlls/cfgmgr32/main.c b/dlls/cfgmgr32/main.c index e6147e0a81c..3a5d973d44e 100644 --- a/dlls/cfgmgr32/main.c +++ b/dlls/cfgmgr32/main.c @@ -395,9 +395,7 @@ done: free( all_keys ); if (FAILED( hr )) { - for (i = 0; i < obj->cPropertyCount; i++) - free( ( (DEVPROPERTY *)obj[i].pProperties )->Buffer ); - free( (DEVPROPERTY *)obj->pProperties ); + DevFreeObjectProperties( obj->cPropertyCount, obj->pProperties ); obj->cPropertyCount = 0; obj->pProperties = NULL; } @@ -565,13 +563,7 @@ void WINAPI DevFreeObjects( ULONG objs_len, const DEV_OBJECT *objs )
for (i = 0; i < objs_len; i++) { - DEVPROPERTY *props = (DEVPROPERTY *)objects[i].pProperties; - ULONG j; - - for (j = 0; j < objects[i].cPropertyCount; j++) - free( props[j].Buffer ); - free( props ); - + DevFreeObjectProperties( objects[i].cPropertyCount, objects[i].pProperties ); free( (void *)objects[i].pszObjectId ); } free( objects ); @@ -848,5 +840,12 @@ HRESULT WINAPI DevGetObjectPropertiesEx( DEV_OBJECT_TYPE type, const WCHAR *id,
void WINAPI DevFreeObjectProperties( ULONG len, const DEVPROPERTY *props ) { - FIXME( "(%lu, %p): stub!\n", len, props ); + DEVPROPERTY *properties = (DEVPROPERTY *)props; + ULONG i; + + TRACE( "(%lu, %p)\n", len, props ); + + for (i = 0; i < len; i++) + free( properties[i].Buffer ); + free( properties ); }