httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r606481 - /httpd/httpd/trunk/support/win32/ApacheMonitor.c
Date Sat, 22 Dec 2007 20:01:00 GMT
Author: wrowe
Date: Sat Dec 22 12:00:59 2007
New Revision: 606481

URL: http://svn.apache.org/viewvc?rev=606481&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>

Modified:
    httpd/httpd/trunk/support/win32/ApacheMonitor.c

Modified: httpd/httpd/trunk/support/win32/ApacheMonitor.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/win32/ApacheMonitor.c?rev=606481&r1=606480&r2=606481&view=diff
==============================================================================
--- httpd/httpd/trunk/support/win32/ApacheMonitor.c (original)
+++ httpd/httpd/trunk/support/win32/ApacheMonitor.c Sat Dec 22 12:00:59 2007
@@ -193,15 +193,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;
     }
-
 }
 
 
@@ -1055,8 +1052,8 @@
             }
         }
         ++computers;
+        RegCloseKey(hKey);
     }
-    RegCloseKey(hKey);
     FindRunningServices();
     return TRUE;
 }



Mime
View raw message