[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] Re: ping: memory leaks

From: Debarshi 'Rishi' Ray
Subject: Re: [bug-inetutils] Re: ping: memory leaks
Date: Mon, 23 Jul 2007 06:32:14 +0530

Are you sure that this is safe?


The main function invokes ping_echo just before returning. ping_echo
invokes ping_run, with a pointer to echo_finish just before returning.
ping_run invokes echo_finish just before returning.

Therefore the "eturn (ping->ping_num_recv == 0);" statement is
practically the last instruction (ignoring the frees) that gets
executed and the returned value cascades back to the return statement
in main. Hence no need for a call to exit.

Preliminary testing (running ping with almost all the various options)
confirms this.

Happy hacking,
GPG key ID: 63D4A5A7
Key server: pgp.mit.edu

reply via email to

[Prev in Thread] Current Thread [Next in Thread]