(w32_get_resource): Always close registry keys.
authorJason Rumney <jasonr@gnu.org>
Sat, 29 Sep 2007 21:33:23 +0000 (21:33 +0000)
committerJason Rumney <jasonr@gnu.org>
Sat, 29 Sep 2007 21:33:23 +0000 (21:33 +0000)
src/w32.c

index eaad690..2b54f3d 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -890,6 +890,7 @@ w32_get_resource (key, lpdwtype)
          && (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL
          && RegQueryValueEx (hrootkey, key, NULL, lpdwtype, lpvalue, &cbData) == ERROR_SUCCESS)
        {
+          RegCloseKey (hrootkey);
          return (lpvalue);
        }
 
@@ -906,6 +907,7 @@ w32_get_resource (key, lpdwtype)
          && (lpvalue = (LPBYTE) xmalloc (cbData)) != NULL
          && RegQueryValueEx (hrootkey, key, NULL, lpdwtype, lpvalue, &cbData) == ERROR_SUCCESS)
        {
+          RegCloseKey (hrootkey);
          return (lpvalue);
        }