diff --git a/src/gnutls.c b/src/gnutls.c index 5a89e064..be043420 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -184,13 +184,13 @@ ssl_init (void) /* Use the private key from the cert file unless otherwise specified. */ if (opt.cert_file && !opt.private_key) { - opt.private_key = opt.cert_file; + opt.private_key = xstrdup (opt.cert_file); opt.private_key_type = opt.cert_type; } /* Use the cert from the private key file unless otherwise specified. */ if (!opt.cert_file && opt.private_key) { - opt.cert_file = opt.private_key; + opt.cert_file = xstrdup (opt.private_key); opt.cert_type = opt.private_key_type; } diff --git a/src/openssl.c b/src/openssl.c index b8a96145..b6cdb8dc 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -292,7 +292,7 @@ ssl_init (void) /* Use the private key from the cert file unless otherwise specified. */ if (opt.cert_file && !opt.private_key) { - opt.private_key = opt.cert_file; + opt.private_key = xstrdup (opt.cert_file); opt.private_key_type = opt.cert_type; }