From 9436fbbf3ca0dca427c7cb8792d48dc6db34c55a Mon Sep 17 00:00:00 2001 From: "pierre.baudry" Date: Thu, 20 Oct 2016 16:30:51 +0200 Subject: transceiver: Fix mismatched allocations and deallocations The behaviour of a mismatched pair of allocation and deallocation is undefined Also fixes a memory leak if malloc fails (which stops the application anyway) Change-Id: I9c8bbade8531e8c9c02dcd43bac38cb954b3c89f --- Transceiver52M/Resampler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Transceiver52M/Resampler.cpp') diff --git a/Transceiver52M/Resampler.cpp b/Transceiver52M/Resampler.cpp index 070adda..8a73b79 100644 --- a/Transceiver52M/Resampler.cpp +++ b/Transceiver52M/Resampler.cpp @@ -61,7 +61,7 @@ bool Resampler::initFilters(float bw) partitions = (float **) malloc(sizeof(float *) * p); if (!partitions) { - free(proto); + delete[] proto; return false; } -- cgit v1.2.3