winecfg: Use Win32 APIs instead of strdup().

Francois Gouget fgouget at free.fr
Wed May 13 03:33:12 CDT 2009


---
 programs/winecfg/audio.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c
index 8e966a5..806239f 100644
--- a/programs/winecfg/audio.c
+++ b/programs/winecfg/audio.c
@@ -543,7 +543,10 @@ static void findAudioDrivers(void)
 static void checkRegistrySetting(HWND hDlg)
 {
     const AUDIO_DRIVER *pAudioDrv;
-    char * token, * tokens = strdup(curAudioDriver);
+    char * token, * tokens;
+
+    tokens = HeapAlloc(GetProcessHeap(), 0, strlen(curAudioDriver)+1);
+    strcpy(tokens, curAudioDriver);
 
 start_over:
     token = strtok(tokens, ",");
@@ -581,7 +584,7 @@ start_over:
         }
         token = strtok(NULL, ",");
     }
-    free(tokens);
+    HeapFree(GetProcessHeap(), 0, tokens);
 }
 
 static void selectDriver(HWND hDlg, const char * driver)
-- 
1.6.2.1




More information about the wine-patches mailing list