[PATCH] programs/ping: add IcmpCloseHandle(icmp_file) and fix a memory leak.

Alexandre Julliard julliard at winehq.org
Tue Dec 22 11:15:40 CST 2020


"Jiangyi Chen" <cjy520lcy at 163.com> writes:

> @@ -218,6 +218,12 @@ int __cdecl main(int argc, char** argv)
>                 min, max, avg);
>      }
>  
> +    if(icmp_file != INVALID_HANDLE_VALUE)
> +    {
> +      IcmpCloseHandle(icmp_file);
> +      icmp_file = INVALID_HANDLE_VALUE;
> +    }
> +    if(send_data) heap_free(send_data);

There's no reason to bother closing handles or freeing data when the
process is exiting anyway.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list