From: Soeren Apel Date: Tue, 7 Aug 2018 18:09:22 +0000 (+0200) Subject: Segment: Catch by reference X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=30fe44fbfb5727c6ca93f10cf4de913b4f13381f;p=pulseview.git Segment: Catch by reference --- diff --git a/pv/data/segment.cpp b/pv/data/segment.cpp index 7b8e611f..5022d6a9 100644 --- a/pv/data/segment.cpp +++ b/pv/data/segment.cpp @@ -194,7 +194,7 @@ void Segment::append_samples(void* data, uint64_t samples) auto dummy_chunk = new uint8_t[dummy_size]; memset(dummy_chunk, 0xFF, dummy_size); delete[] dummy_chunk; - } catch (bad_alloc) { + } catch (bad_alloc&) { delete[] current_chunk_; // The new may have succeeded current_chunk_ = nullptr; throw;