# HG changeset patch # User Matt Johnston # Date 1170510647 0 # Node ID ea0929224294c8c0dece70bbdd921b8f106c36d1 # Parent 2448ae3e75b5244f62299d745b821bccd6ac055f Fix another leak found by Klocwork diff -r 2448ae3e75b5 -r ea0929224294 cli-runopts.c --- a/cli-runopts.c Sat Feb 03 13:31:01 2007 +0000 +++ b/cli-runopts.c Sat Feb 03 13:50:47 2007 +0000 @@ -358,8 +358,7 @@ TRACE(("connectaddr == NULL")) goto fail; } - - connectaddr[0] = '\0'; + *connectaddr = '\0'; connectaddr++; connectport = strchr(connectaddr, ':'); @@ -367,8 +366,7 @@ TRACE(("connectport == NULL")) goto fail; } - - connectport[0] = '\0'; + *connectport = '\0'; connectport++; newfwd = (struct TCPFwdList*)m_malloc(sizeof(struct TCPFwdList)); @@ -402,6 +400,8 @@ newfwd->next = *fwdlist; *fwdlist = newfwd; + m_free(str); + TRACE(("leave addforward: done")) return;