diff --git a/sys/ximage/gstximagesrc.c b/sys/ximage/gstximagesrc.c
index cdb4a1d..6e91485 100644
--- a/sys/ximage/gstximagesrc.c
+++ b/sys/ximage/gstximagesrc.c
@@ -456,6 +456,9 @@ gst_ximage_src_ximage_get (GstXImageSrc * ximagesrc)
 
   g_mutex_lock (&ximagesrc->pool_lock);
   while (ximagesrc->buffer_pool != NULL) {
+    if (ximage != NULL) // pool not empty yet, free previous ximage
+      gst_ximage_buffer_free (ximage);
+
     ximage = ximagesrc->buffer_pool->data;
 
     meta = GST_META_XIMAGE_GET (ximage);
