summaryrefslogtreecommitdiff
path: root/src/frame.cc
diff options
context:
space:
mode:
authordeva <deva>2005-04-26 09:40:36 +0000
committerdeva <deva>2005-04-26 09:40:36 +0000
commitcbe7247fff0a395f804b35d2047c3994fa0fd675 (patch)
treea0663a2981a47fc9ec3dca6a2db8bb4f56525bfd /src/frame.cc
parentd2458728cd226a2651005acfd3241e1a5f77782c (diff)
Removed frame memoryleak
Diffstat (limited to 'src/frame.cc')
-rw-r--r--src/frame.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/frame.cc b/src/frame.cc
index 6a1ba70..4b94fcb 100644
--- a/src/frame.cc
+++ b/src/frame.cc
@@ -28,13 +28,20 @@
#include "debug.h"
+#include <memory.h>
+#include <stdlib.h>
+
Frame::Frame(unsigned char *d, int sz)
{
- data = d;
+ data = (unsigned char *)malloc(sz);
+ memcpy(data, d, sz);
size = sz;
}
Frame::~Frame()
{
+ free(data);
+ data = NULL;
+ size = 0;
}