You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2007/12/22 21:03:31 UTC

svn commit: r606482 - /httpd/httpd/branches/2.2.x/support/win32/ApacheMonitor.c

Author: wrowe
Date: Sat Dec 22 12:03:31 2007
New Revision: 606482

URL: http://svn.apache.org/viewvc?rev=606482&view=rev
Log:
Solve service status handle leak on multi-service ApacheMonitor
instances, and disconnect computer function on multi-system
applications of ApacheMonitor.

PR: 33803
Reported by: K.W.Schick <drax sawebs.com>
Backport: 606481

Modified:
    httpd/httpd/branches/2.2.x/support/win32/ApacheMonitor.c

Modified: httpd/httpd/branches/2.2.x/support/win32/ApacheMonitor.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/support/win32/ApacheMonitor.c?rev=606482&r1=606481&r2=606482&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/support/win32/ApacheMonitor.c (original)
+++ httpd/httpd/branches/2.2.x/support/win32/ApacheMonitor.c Sat Dec 22 12:03:31 2007
@@ -186,15 +186,12 @@
         free(g_stComputers[i].szComputerName);
         RegCloseKey(g_stComputers[i].hRegistry);
         for (j = i; j < MAX_APACHE_COMPUTERS - 1; j++) {
-            g_stComputers[i].szComputerName= g_stComputers[i+1].szComputerName;
-            g_stComputers[i].hRegistry = g_stComputers[i+1].hRegistry;
-        }
-        for (i = j; i < MAX_APACHE_COMPUTERS; i++) {
-            g_stComputers[i].szComputerName = NULL;
-            g_stComputers[i].hRegistry = NULL;
+            g_stComputers[j].szComputerName= g_stComputers[j+1].szComputerName;
+            g_stComputers[j].hRegistry = g_stComputers[j+1].hRegistry;
         }
+        g_stComputers[j].szComputerName = NULL;
+        g_stComputers[j].hRegistry = NULL;
     }
-
 }
 
 
@@ -1048,8 +1045,8 @@
             }
         }
         ++computers;
+        RegCloseKey(hKey);
     }
-    RegCloseKey(hKey);
     FindRunningServices();
     return TRUE;
 }