summaryrefslogtreecommitdiffstats
path: root/crypto/cmp
diff options
context:
space:
mode:
authorPetr Gotthard <petr.gotthard@centrum.cz>2021-05-25 15:39:01 +0200
committerRichard Levitte <levitte@openssl.org>2021-05-28 11:11:53 +0200
commit32075a17249636b3e2986a0ac422b1803663ccaa (patch)
tree40ac9f3832782dcfe793ac8046b0a7a457c0029c /crypto/cmp
parenta935791d54078f43209ffbc1886ac5e68772ce34 (diff)
Fix memory leak in OSSL_CMP_CTX
The ctx->propq is strdup'ed, so it must be free'd too. Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15458)
Diffstat (limited to 'crypto/cmp')
-rw-r--r--crypto/cmp/cmp_ctx.c1
-rw-r--r--crypto/cmp/cmp_local.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/crypto/cmp/cmp_ctx.c b/crypto/cmp/cmp_ctx.c
index a09432597b..d1f8f27e13 100644
--- a/crypto/cmp/cmp_ctx.c
+++ b/crypto/cmp/cmp_ctx.c
@@ -179,6 +179,7 @@ void OSSL_CMP_CTX_free(OSSL_CMP_CTX *ctx)
(void)OSSL_HTTP_close(ctx->http_ctx, 1);
ossl_cmp_debug(ctx, "disconnected from CMP server");
}
+ OPENSSL_free(ctx->propq);
OPENSSL_free(ctx->serverPath);
OPENSSL_free(ctx->server);
OPENSSL_free(ctx->proxy);
diff --git a/crypto/cmp/cmp_local.h b/crypto/cmp/cmp_local.h
index eee609937b..fec4916ed3 100644
--- a/crypto/cmp/cmp_local.h
+++ b/crypto/cmp/cmp_local.h
@@ -32,7 +32,7 @@
*/
struct ossl_cmp_ctx_st {
OSSL_LIB_CTX *libctx;
- const char *propq;
+ char *propq;
OSSL_CMP_log_cb_t log_cb; /* log callback for error/debug/etc. output */
OSSL_CMP_severity log_verbosity; /* level of verbosity of log output */