Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit992cba9

Browse files
committed
Fix memory leak when initializing DH parameters in backend
When loading DH parameters used for the generation of ephemeral DH keysin the backend, the code has never bothered releasing the memory usedfor the DH information loaded from a file or from libpq's default. Thiscommit makes sure that the information is properly free()'d.Back-patch ofe0e569e. We originally thought the leak was minor andnot worth back-patching, but Jelte Fennema pointed out that repeatedSIGHUP's can result in very serious bloat of the postmaster, which isthen multiplied by being duplicated into eadh forked child.Back-patch to v10; the code looked different beforec0a15e0,and didn't have a leak in the actually-live code paths.Michael PaquierDiscussion:https://postgr.es/m/16160-18367e56e9a28264@postgresql.org
1 parent4eca51d commit992cba9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎src/backend/libpq/be-secure-openssl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,11 @@ initialize_dh(SSL_CTX *context, bool isServerStart)
10291029
(errcode(ERRCODE_CONFIG_FILE_ERROR),
10301030
(errmsg("DH: could not set DH parameters: %s",
10311031
SSLerrmessage(ERR_get_error())))));
1032+
DH_free(dh);
10321033
return false;
10331034
}
1035+
1036+
DH_free(dh);
10341037
return true;
10351038
}
10361039

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp