ActivityMonitor: fixed minor issue CID 609788.
* If the circular buffer was created with a size of zero, fBuffer would be freed without being initialized.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2009, Axel Dörfler, [email protected].
|
||||
* Copyright 2008-2013, Axel Dörfler, [email protected].
|
||||
* 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
|
||||
|
||||
Reference in New Issue
Block a user