avoid-leak-handle-pg_ctl.patch
application/octet-stream
Filename: avoid-leak-handle-pg_ctl.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/bin/pg_ctl/pg_ctl.c | 5 | 0 |
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 8a405ff122..04cbb6b28c 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -1811,14 +1811,19 @@ CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo, bool as_ser
{
write_stderr(_("%s: could not allocate SIDs: error code %lu\n"),
progname, (unsigned long) GetLastError());
+ CloseHandle(origToken);
return 0;
}
/* Get list of privileges to remove */
delPrivs = GetPrivilegesToDelete(origToken);
if (delPrivs == NULL)
+ {
+ CloseHandle(origToken);
+
/* Error message already printed */
return 0;
+ }
b = CreateRestrictedToken(origToken,
0,