cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH 4/8] tool_getparam: fix memleak in handling the -E option

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Fri, 3 May 2013 23:32:50 +0200

---
 src/tool_getparam.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 2b7fa4e..06bffeb 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -1303,11 +1303,11 @@ ParameterError getparameter(char *flag,    /* f or -long-flag */
       {
         char *certname, *passphrase;
         parse_cert_parameter(nextarg, &certname, &passphrase);
-        if(certname) {
-          GetStr(&config->cert, certname);
-        }
+        Curl_safefree(config->cert);
+        config->cert = certname;
         if(passphrase) {
-          GetStr(&config->key_passwd, passphrase);
+          Curl_safefree(config->key_passwd);
+          config->key_passwd = passphrase;
         }
         cleanarg(nextarg);
       }
-- 
1.7.1
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-05-03