[Git][NTPsec/ntpsec][master] Avoid resource leak from "server" variable
Hal Murray
gitlab at mg.gitlab.com
Mon Nov 4 05:48:24 UTC 2019
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
01eee1ed by Matt Selsky at 2019-11-04T05:11:42Z
Avoid resource leak from "server" variable
Fixes NTPsec/ntpsec#620
- - - - -
1 changed file:
- ntpd/nts_client.c
Changes:
=====================================
ntpd/nts_client.c
=====================================
@@ -119,8 +119,10 @@ bool nts_probe(struct peer * peer) {
else {
SSL_CTX *ctx;
ctx = make_ssl_client_ctx(peer->cfg.nts_cfg.ca);
- if (NULL == ctx)
+ if (NULL == ctx) {
+ close(server);
return false;
+ }
ssl = SSL_new(ctx);
SSL_CTX_free(ctx);
}
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/01eee1edff23bf7d4fea4b5cf452acc7ea8af820
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/01eee1edff23bf7d4fea4b5cf452acc7ea8af820
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20191104/d0ff553e/attachment.htm>
More information about the vc
mailing list