diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2009-02-23 13:44:04 -0800 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2009-02-23 13:44:04 -0800 |
commit | f6a842748d17234124c3790b8b4b7339f612e5c4 (patch) | |
tree | 6163a2604df578d03c30325be9d10077fad06198 | |
parent | 32b3fd297ab42534096074d896becc1964518907 (diff) | |
download | libnet-f6a842748d17234124c3790b8b4b7339f612e5c4.tar.gz |
06-fix_libnet_pblock_coalesce_leak.patch from debian source package
See http://packages.debian.org/source/sid/libnet
-rw-r--r-- | libnet/src/libnet_pblock.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libnet/src/libnet_pblock.c b/libnet/src/libnet_pblock.c index 9da014f..ae12db9 100644 --- a/libnet/src/libnet_pblock.c +++ b/libnet/src/libnet_pblock.c @@ -339,7 +339,7 @@ libnet_pblock_coalesce(libnet_t *l, u_int8_t **packet, u_int32_t *size) snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): packet assembly cannot find a layer 2 header\n", __func__); - return (-1); + goto err; } break; case LIBNET_RAW4: @@ -348,7 +348,7 @@ libnet_pblock_coalesce(libnet_t *l, u_int8_t **packet, u_int32_t *size) snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): packet assembly cannot find an IPv4 header\n", __func__); - return (-1); + goto err; } break; case LIBNET_RAW6: @@ -357,7 +357,7 @@ libnet_pblock_coalesce(libnet_t *l, u_int8_t **packet, u_int32_t *size) snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): packet assembly cannot find an IPv6 header\n", __func__); - return (-1); + goto err; } break; default: @@ -365,7 +365,7 @@ libnet_pblock_coalesce(libnet_t *l, u_int8_t **packet, u_int32_t *size) snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): suddenly the dungeon collapses -- you die\n", __func__); - return (-1); + goto err; break; } } @@ -419,6 +419,10 @@ libnet_pblock_coalesce(libnet_t *l, u_int8_t **packet, u_int32_t *size) *size -= l->aligner; } return (1); + +err: + free(packet); + return (-1); } void |