diff --git a/src/gstcamerasrc.cpp b/src/gstcamerasrc.cpp index 59567ec..78ca8b8 100644 --- a/src/gstcamerasrc.cpp +++ b/src/gstcamerasrc.cpp @@ -1483,6 +1483,7 @@ static GstPad *gst_camerasrc_request_new_pad (GstElement * element, req_pad = GST_CAM_BASE_SRC_CLASS (parent_class)->add_video_pad(basesrc, klass, videopad, index, padname); if (!req_pad) { GST_ERROR("CameraId=%d failed to add video source pad.", camerasrc->device_id); + g_free(padname); GST_CAMSRC_UNLOCK(camerasrc); return NULL; } diff --git a/src/gstcamerasrcbufferpool.cpp b/src/gstcamerasrcbufferpool.cpp index 4b14b71..7b21d96 100644 --- a/src/gstcamerasrcbufferpool.cpp +++ b/src/gstcamerasrcbufferpool.cpp @@ -535,7 +535,7 @@ gst_camerasrc_alloc_dma_export(GstCamerasrcBufferPool *pool, return GST_FLOW_ERROR; } - int dmafd = dup ((*meta)->buffer->dmafd); + int dmafd = (*meta)->buffer->dmafd; if (dmafd < 0) goto err_get_fd; @@ -588,7 +588,7 @@ gst_camerasrc_alloc_dma_import(GstCamerasrcBufferPool *pool, mem = gst_buffer_peek_memory(*alloc_buffer, 0); - (*meta)->buffer->dmafd = dup(gst_dmabuf_memory_get_fd(mem)); + (*meta)->buffer->dmafd = gst_dmabuf_memory_get_fd(mem); if ((*meta)->buffer->dmafd < 0) goto err_get_fd;