From bc4dd456f98b23344169bd0c47e2e5b052f5539c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 19 Mar 2013 00:56:47 +0100 Subject: [PATCH] ActivityMonitor: fixed minor issue CID 609788. * If the circular buffer was created with a size of zero, fBuffer would be freed without being initialized. --- src/apps/activitymonitor/CircularBuffer.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apps/activitymonitor/CircularBuffer.h b/src/apps/activitymonitor/CircularBuffer.h index 12ff3ada55..6bce954f94 100644 --- a/src/apps/activitymonitor/CircularBuffer.h +++ b/src/apps/activitymonitor/CircularBuffer.h @@ -1,5 +1,5 @@ /* - * Copyright 2008-2009, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2008-2013, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ #ifndef CIRCULAR_BUFFER_H @@ -16,7 +16,8 @@ class CircularBuffer { public: CircularBuffer(size_t size) : - fSize(0) + fSize(0), + fBuffer(NULL) { SetSize(size); } @@ -96,4 +97,5 @@ private: Type* fBuffer; }; + #endif // CIRCULAR_BUFFER_H