From 97b141d26798c39ccc5a774b6e041a4646a12d29 Mon Sep 17 00:00:00 2001 From: Manolis Surligas Date: Sat, 2 Apr 2016 22:26:31 +0300 Subject: [PATCH] Fix a memory allocation issue --- lib/udp_msg_source_impl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/udp_msg_source_impl.cc b/lib/udp_msg_source_impl.cc index 237e126..d839f1a 100644 --- a/lib/udp_msg_source_impl.cc +++ b/lib/udp_msg_source_impl.cc @@ -100,7 +100,7 @@ namespace gr } /* All good until now. Allocate buffer memory and proceed */ - buf = new uint8_t(d_mtu); + buf = new uint8_t[d_mtu]; while(d_running){ ret = recvfrom(sock, buf, d_mtu, 0, &client_addr, &client_addr_len); @@ -115,7 +115,7 @@ namespace gr } } close(sock); - delete buf; + delete[] buf; exit (EXIT_SUCCESS); }