Re: Stumped on IPv6 ping in c language with PF_PACKET/SOCK_DGRAM
- From: Jorgen Grahn <grahn+nntp@xxxxxxxxxxxxxx>
- Date: 3 Nov 2011 11:36:38 GMT
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 .
.
- Follow-Ups:
- References:
- Stumped on IPv6 ping in c language with PF_PACKET/SOCK_DGRAM
- From: pdbuchan
- Re: Stumped on IPv6 ping in c language with PF_PACKET/SOCK_DGRAM
- From: Richard Kettlewell
- Stumped on IPv6 ping in c language with PF_PACKET/SOCK_DGRAM
- Prev by Date: Re: Re (2): ? Too many connections from your IP address ?
- Next by Date: Re: Slow loading web pages
- Previous by thread: Re: Stumped on IPv6 ping in c language with PF_PACKET/SOCK_DGRAM
- Next by thread: Re: Stumped on IPv6 ping in c language with PF_PACKET/SOCK_DGRAM
- Index(es):
Relevant Pages
|