Commit 608b11a9 authored by Martin Vejnár's avatar Martin Vejnár Committed by Daniel Stenberg
Browse files

win32: fix a potential memory leak in Curl_load_library

If a call to GetSystemDirectory fails, the `path` pointer that was
previously allocated would be leaked. This makes sure that `path` is
always freed.

Closes #938
parent d6604524
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -281,8 +281,8 @@ HMODULE Curl_load_library(LPCTSTR filename)
          pLoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) :
          LoadLibrary(path);

        free(path);
      }
      free(path);
    }
  }