Re: Stumped on IPv6 ping in c language with PF_PACKET/SOCK_DGRAM



On Wed, 2011-11-02, Richard Kettlewell wrote:

[snip things I agree with]

free (interface);
free (src);
free (target);
free (payload);
free (packet);

return (EXIT_SUCCESS);

There is no point calling free() just before exiting. The OS will clean
up for you.

There are no leaks, but there are two points:
- as a reminder that things were malloced and will need
to be freed if this code is reused elsewhere
- the valgrind(1) leak checker will be happier and
complain less about "possible leaks" or whatever it calls it

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
.



Relevant Pages

  • Re: OT "House of Saud
    ... >> be stored above ground (to check for leaks) for several ... I think nuclear power is out for the US, ... >political structure cannot handle the responsibility. ...
    (talk.origins)
  • Re: OT "House of Saud
    ... highly radioactive material needs to ... > be stored above ground (to check for leaks) for several ... Guns don't kill people; automobiles kill people. ...
    (talk.origins)
  • Re: The Cause of the Fall
    ... Part of the problem is the lack of transparency here. ... All the info comes from leaks on both sides of the fence and these leaks ...
    (rec.sport.cricket)
  • Re: RenderFile leaking with WMV files.
    ... WAV file. ... There have been reports of WM handle leaks here before. ... Trim & respond inline (please don't top post or snip everything) ...
    (microsoft.public.win32.programmer.directx.video)