msdk: release resources if failing to create the buffer pool
[platform/upstream/gstreamer.git] / sys / msdk / gstmsdkenc.c
index c3e16ce..6f90249 100644 (file)
@@ -952,11 +952,14 @@ error_no_pool:
 error_no_allocator:
   {
     GST_INFO_OBJECT (thiz, "failed to create allocator");
+    gst_object_unref (pool);
     return FALSE;
   }
 error_pool_config:
   {
     GST_INFO_OBJECT (thiz, "failed to set config");
+    gst_object_unref (pool);
+    gst_object_unref (allocator);
     return FALSE;
   }
 }