postmaster_leak.patch
application/octet-stream
Filename: postmaster_leak.patch
Type: application/octet-stream
Part: 2
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/backend/postmaster/postmaster.c | 6 | 0 |
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 7a92dac525..b3986bee75 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -4719,6 +4719,8 @@ retry:
if (cmdLine[sizeof(cmdLine) - 2] != '\0')
{
elog(LOG, "subprocess command line too long");
+ UnmapViewOfFile(param);
+ CloseHandle(paramHandle);
return -1;
}
@@ -4735,6 +4737,8 @@ retry:
{
elog(LOG, "CreateProcess call failed: %m (error code %lu)",
GetLastError());
+ UnmapViewOfFile(param);
+ CloseHandle(paramHandle);
return -1;
}
@@ -4750,6 +4754,8 @@ retry:
GetLastError())));
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
+ UnmapViewOfFile(param);
+ CloseHandle(paramHandle);
return -1; /* log made by save_backend_variables */
}