summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib
diff options
context:
space:
mode:
authorEric Blossom2010-05-19 20:06:26 -0700
committerEric Blossom2010-05-19 20:06:26 -0700
commit99a39a4351ca250dcbeeface0ab7b9de6e301d49 (patch)
treeee21090f4082a51cedaec6a04f4f9f88c49ae335 /gnuradio-core/src/lib
parent0058f55926c8e9f6ecb37f153ff7464b93838484 (diff)
downloadgnuradio-99a39a4351ca250dcbeeface0ab7b9de6e301d49.tar.gz
gnuradio-99a39a4351ca250dcbeeface0ab7b9de6e301d49.tar.bz2
gnuradio-99a39a4351ca250dcbeeface0ab7b9de6e301d49.zip
Identify memory leaks that occur on error conditions
Diffstat (limited to 'gnuradio-core/src/lib')
-rwxr-xr-xgnuradio-core/src/lib/io/gr_udp_sink.cc2
-rwxr-xr-xgnuradio-core/src/lib/io/gr_udp_source.cc3
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 2ee16b79f..3084a848b 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 b1c25382c..063cd7b50 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