1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-05 01:26:24 +00:00

Fix leaks

This commit is contained in:
Carles Fernandez 2019-03-03 00:16:57 +01:00
parent 08ce4cdd75
commit c4d9a3631c
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 8 additions and 0 deletions

View File

@ -89,6 +89,7 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
if (!rx_signal_file) if (!rx_signal_file)
{ {
std::cerr << "Unable to open file!" << std::endl; std::cerr << "Unable to open file!" << std::endl;
free(buffer_float);
return; return;
} }
@ -123,6 +124,9 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
if (!buffer_DMA) if (!buffer_DMA)
{ {
std::cerr << "Memory error!" << std::endl; std::cerr << "Memory error!" << std::endl;
free(buffer_float);
fclose(rx_signal_file);
return;
} }
// open the DMA descriptor // open the DMA descriptor
@ -130,6 +134,9 @@ void thread_acquisition_send_rx_samples(gr::top_block_sptr top_block,
if (dma_descr < 0) if (dma_descr < 0)
{ {
std::cerr << "Can't open loop device\n"; std::cerr << "Can't open loop device\n";
free(buffer_float);
free(buffer_DMA);
fclose(rx_signal_file);
return; return;
} }

View File

@ -87,6 +87,7 @@ void send_tracking_gps_input_samples(FILE *rx_signal_file,
if (!buffer_DMA) if (!buffer_DMA)
{ {
std::cerr << "Memory error!" << std::endl; std::cerr << "Memory error!" << std::endl;
close(dma_descr);
return; return;
} }