]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
addressed memory leak in crywrap.c
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 3 Mar 2014 10:36:16 +0000 (11:36 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 3 Mar 2014 10:36:53 +0000 (11:36 +0100)
src/crywrap/crywrap.c

index f1b822cb6da583599507795ee3b4b4faeba78dc5..b403fd6009a3fe9dcd3ff6ad0fc8c9ec6c65fefe 100644 (file)
@@ -321,7 +321,7 @@ static int
 _crywrap_parse_ip(const char *ip, in_port_t * port,
                  struct sockaddr_storage **addr, char **host)
 {
-       char *s_ip;
+       char *s_ip = NULL;
        char *tmp;
 
        tmp = strchr(ip, '/');
@@ -343,7 +343,9 @@ _crywrap_parse_ip(const char *ip, in_port_t * port,
        if (host)
                *host = strdup(s_ip);
 
-       return _crywrap_addr_get(s_ip, addr);
+       ret = _crywrap_addr_get(s_ip, addr);
+       free(s_ip);
+       return ret;
 }
 
 /** Argument parsing routine.