[or-cvs] r17118: {torvm} Fix another allocation error (torvm/trunk/build/win32/src/torvm-w32)

coderman at seul.org coderman at seul.org
Thu Oct 16 00:18:22 UTC 2008


Author: coderman
Date: 2008-10-15 20:18:22 -0400 (Wed, 15 Oct 2008)
New Revision: 17118

Modified:
   torvm/trunk/build/win32/src/torvm-w32/torvm.c
Log:
Fix another allocation error

Modified: torvm/trunk/build/win32/src/torvm-w32/torvm.c
===================================================================
--- torvm/trunk/build/win32/src/torvm-w32/torvm.c	2008-10-16 00:01:51 UTC (rev 17117)
+++ torvm/trunk/build/win32/src/torvm-w32/torvm.c	2008-10-16 00:18:22 UTC (rev 17118)
@@ -343,6 +343,7 @@
                      &pi) ) {
     lerror ("Failed to launch process.  Error code: %d", GetLastError());
   }
+  free (cmd);
 
   linfo ("waiting for TAP-Win32 driver install to complete ...");
   while ( GetExitCodeProcess(pi.hProcess, &exitcode) && (exitcode == STILL_ACTIVE) ) {
@@ -389,6 +390,7 @@
   ZeroMemory( &si, sizeof(si) );
   si.cb = sizeof(si);
   cmdlen = strlen(devcon) + 64;
+  cmd = (LPTSTR)malloc(cmdlen);
   snprintf (cmd, cmdlen, "\"%s\" install tortap91.inf TORTAP91", devcon);
   ldebug ("Tap un-install pwd: %s, cmd: %s", dir, cmd);
  
@@ -406,7 +408,8 @@
     lerror ("Failed to launch process.  Error code: %d", GetLastError());
     return FALSE;
   }
-  
+  free (cmd);
+
   while ( GetExitCodeProcess(pi.hProcess, &exitcode) && (exitcode == STILL_ACTIVE) ) {
     Sleep (200);
   }



More information about the tor-commits mailing list