Identify memory leaks that occur on error conditions
authorEric Blossom <eb@comsec.com>
Thu, 20 May 2010 03:06:26 +0000 (20:06 -0700)
committerEric Blossom <eb@comsec.com>
Thu, 20 May 2010 03:06:26 +0000 (20:06 -0700)
gnuradio-core/src/lib/io/gr_udp_sink.cc
gnuradio-core/src/lib/io/gr_udp_source.cc

index 2ee16b79f21020d45583fac12b5b489f2e973c60..3084a848be7a78c537af79e069703ca404533052 100755 (executable)
@@ -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",
index b1c25382c229f9016a56c39adefd96bd8dafa40b..063cd7b507fa550930295d9302b07eb3f7311f3f 100755 (executable)
@@ -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