Skip to content

Commit

Permalink
fix leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
astrelsky committed Nov 27, 2024
1 parent c9355c1 commit d26ad73
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions native/common/jp_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Win32PlatformAdapter : public JPPlatformAdapter
wchar_t *tmp = wcsstr(wpath, L"bin\\server\\jvm.dll");
if (tmp == NULL)
{
PyMem_RawFree(wpath);
PyErr_Format(PyExc_ValueError, "Unable to get JVM bin path from %s", path);
JP_RAISE_PYTHON();
}
Expand All @@ -80,6 +81,7 @@ class Win32PlatformAdapter : public JPPlatformAdapter
// there may be multiple in the current system PATH
if (!SetDllDirectoryW(wpath))
{
PyMem_RawFree(wpath);
JP_RAISE_OS_ERROR_WINDOWS( GetLastError(), path);
}
tmp[3] = L'\\';
Expand Down

0 comments on commit d26ad73

Please sign in to comment.