diff options
author | Eric Blossom <eb@comsec.com> | 2010-05-19 20:06:26 -0700 |
---|---|---|
committer | Eric Blossom <eb@comsec.com> | 2010-05-19 20:06:26 -0700 |
commit | 99a39a4351ca250dcbeeface0ab7b9de6e301d49 (patch) | |
tree | ee21090f4082a51cedaec6a04f4f9f88c49ae335 | |
parent | 0058f55926c8e9f6ecb37f153ff7464b93838484 (diff) |
Identify memory leaks that occur on error conditions
-rwxr-xr-x | gnuradio-core/src/lib/io/gr_udp_sink.cc | 2 | ||||
-rwxr-xr-x | gnuradio-core/src/lib/io/gr_udp_source.cc | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/io/gr_udp_sink.cc b/gnuradio-core/src/lib/io/gr_udp_sink.cc index 2ee16b79f2..3084a848be 100755 --- a/gnuradio-core/src/lib/io/gr_udp_sink.cc +++ b/gnuradio-core/src/lib/io/gr_udp_sink.cc @@ -221,6 +221,8 @@ void gr_udp_sink::connect( const char *host, unsigned short port ) hints.ai_protocol = IPPROTO_UDP; char port_str[12]; sprintf( port_str, "%d", port ); + + // FIXME leaks if report_error throws below int ret = getaddrinfo( host, port_str, &hints, &ip_dst ); if( ret != 0 ) report_error("gr_udp_source/getaddrinfo", diff --git a/gnuradio-core/src/lib/io/gr_udp_source.cc b/gnuradio-core/src/lib/io/gr_udp_source.cc index b1c25382c2..063cd7b507 100755 --- a/gnuradio-core/src/lib/io/gr_udp_source.cc +++ b/gnuradio-core/src/lib/io/gr_udp_source.cc @@ -128,11 +128,14 @@ gr_udp_source::gr_udp_source(size_t itemsize, const char *host, hints.ai_flags = AI_PASSIVE; char port_str[12]; sprintf( port_str, "%d", port ); + + // FIXME leaks if report_error throws below ret = getaddrinfo( host, port_str, &hints, &ip_src ); if( ret != 0 ) report_error("gr_udp_source/getaddrinfo", "can't initialize source socket" ); + // FIXME leaks if report_error throws below d_temp_buff = new char[d_payload_size]; // allow it to hold up to payload_size bytes // create socket |