From: Antonio Ospite Date: Mon, 25 Sep 2017 09:47:12 +0000 (+0200) Subject: Replace g_malloc+memcpy with g_memdup X-Git-Url: https://git.ao2.it/gst-aseq-appsrc.git/commitdiff_plain/d579e6473dc66a60b98ac3ebbbdccaca22b033ee Replace g_malloc+memcpy with g_memdup --- diff --git a/gst-aseq-appsrc.c b/gst-aseq-appsrc.c index d15ed6e..b6d38d0 100644 --- a/gst-aseq-appsrc.c +++ b/gst-aseq-appsrc.c @@ -186,8 +186,7 @@ push_buffer (App * app, gpointer data, guint size) GST_BUFFER_OFFSET (buffer) = time; GST_BUFFER_DURATION (buffer) = DEFAULT_TICK_PERIOD_MS * GST_MSECOND; - local_data = g_malloc (size); - memcpy (local_data, data, size); + local_data = g_memdup (data, size); gst_buffer_append_memory (buffer, gst_memory_new_wrapped (0, local_data, size, 0, size, local_data,