From 06d25497ffa7cdabad97f17586fa0aa5340a2b0b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 23 Jan 2020 09:21:04 +0100 Subject: [PATCH] pki: Avoid uneeded memory duplication CID #1412375 Signed-off-by: Andreas Schneider Reviewed-by: Jakub Jelen --- src/pki.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pki.c b/src/pki.c index ae470ffc..a5d837dc 100644 --- a/src/pki.c +++ b/src/pki.c @@ -1610,9 +1610,9 @@ bool ssh_pki_is_uri(const char *cmp) */ char *ssh_pki_export_pub_uri_from_priv_uri(const char *priv_uri) { - char *pub_uri_temp = strdup(priv_uri); + char *pub_uri_temp = NULL; - pub_uri_temp = ssh_strreplace(pub_uri_temp, + pub_uri_temp = ssh_strreplace(priv_uri, "type=private", "type=public");