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.
This commit is contained in:
Erik Walthinsen 2001-09-15 09:12:39 +00:00
parent 8b29840f55
commit 557b4281ce

View file

@ -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