Commit 42b2a69a authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

hnetcfg: Fix realloc handling in fw_app_put_ProcessImageFileName().

parent 95aa1bab
...@@ -269,7 +269,7 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName( ...@@ -269,7 +269,7 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
fw_app *This = impl_from_INetFwAuthorizedApplication( iface ); fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
UNIVERSAL_NAME_INFOW *info; UNIVERSAL_NAME_INFOW *info;
DWORD sz, longsz; DWORD sz, longsz;
WCHAR *path; WCHAR *path, *new_path;
DWORD res; DWORD res;
FIXME("%p, %s\n", This, debugstr_w(image)); FIXME("%p, %s\n", This, debugstr_w(image));
...@@ -303,11 +303,12 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName( ...@@ -303,11 +303,12 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
longsz = GetLongPathNameW(path, path, sz); longsz = GetLongPathNameW(path, path, sz);
if (longsz > sz) if (longsz > sz)
{ {
if (!(path = realloc(path, longsz * sizeof(WCHAR)))) if (!(new_path = realloc(path, longsz * sizeof(WCHAR))))
{ {
free(path); free(path);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
path = new_path;
GetLongPathNameW(path, path, longsz); GetLongPathNameW(path, path, longsz);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment