summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Walthinsen <omega@temple-baptist.org>2001-09-15 09:12:39 +0000
committerErik Walthinsen <omega@temple-baptist.org>2001-09-15 09:12:39 +0000
commit557b4281ce7606a16ff8dd8b157d3a4813b31f3b (patch)
treebda597d73847c52b0ab43188038ef03262f33757
parent8b29840f559c8b8e0b7cef5e951513dfdaa2ba29 (diff)
downloadgstreamer-557b4281ce7606a16ff8dd8b157d3a4813b31f3b.tar.gz
Move newbuf creation to the non-copyfunc case, since the copyfunc is now assumed to create the buffer (from a bufferp...
Original commit message from CVS: Move newbuf creation to the non-copyfunc case, since the copyfunc is now assumed to create the buffer (from a bufferpool, perhaps). This solves a memory leak.
-rw-r--r--gst/gstbuffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c
index 8645ead920..fc61d55907 100644
--- a/gst/gstbuffer.c
+++ b/gst/gstbuffer.c
@@ -352,13 +352,13 @@ gst_buffer_copy (GstBuffer *buffer)
{
GstBuffer *newbuf;
- // allocate a new buffer
- newbuf = gst_buffer_new();
-
// if a copy function exists, use it, else copy the bytes
if (buffer->copy != NULL) {
newbuf = (buffer->copy)(buffer);
} else {
+ // allocate a new buffer
+ newbuf = gst_buffer_new();
+
// copy the absolute size
newbuf->size = buffer->size;
// allocate space for the copy