Memory leak in Libnet
<[email protected]> Mon, 5 Apr 2004 18:08:12 -0700 (PDT)
| Newsgroups | gmane.comp.security.libnet |
|---|---|
| Message-ID | <[email protected]> |
Hi Mike,
It seems the following "strdup" is a memory leak
libnet-1.1.2:
[libnet_if_addr.c]
238
239 if ((al->device = strdup(device)) == NULL)
240 {
241 snprintf(errbuf, LIBNET_ERRBUF_SIZE,
242 "%s(): strdup not enough memory\n", __func__);
243 return(-1);
244 }
Should we do a "free" before each strdup() except when al->device
is NULL ?
Thanks
Kevin