Ping tech@,

Any developer can comment on this patch? I think it is indeed a bug.

Thanks!

On 9/30/2018 11:55 AM, Nan Xiao wrote:
> Hi tech@,
> 
> The following patch fixed the resource leak when netcat works as a TLS
> server. Sorry if I am wrong, thanks!
> 
> 
> Index: netcat.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/nc/netcat.c,v
> retrieving revision 1.194
> diff -u -p -r1.194 netcat.c
> --- netcat.c  7 Sep 2018 09:55:29 -0000       1.194
> +++ netcat.c  30 Sep 2018 03:50:03 -0000
> @@ -633,6 +633,11 @@ main(int argc, char *argv[])
>                       if (!kflag)
>                               break;
>               }
> +
> +             if (tls_ctx) {
> +                     tls_free(tls_ctx);
> +                     tls_ctx = NULL;
> +             }
>       } else if (family == AF_UNIX) {
>               ret = 0;
> 

-- 
Best Regards
Nan Xiao

Reply via email to