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:
parent
08ce4cdd75
commit
c4d9a3631c
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user