diff --git a/internal/capture/gst/gst.go b/internal/capture/gst/gst.go index 31b9e504..d14711ef 100644 --- a/internal/capture/gst/gst.go +++ b/internal/capture/gst/gst.go @@ -172,9 +172,9 @@ func CreatePipeline(pipelineStr string, clockRate float32) (*Pipeline, error) { var gstError *C.GError gstPipeline = C.gst_parse_launch(pipelineStrUnsafe, &gstError) - defer C.g_error_free(gstError) if gstError != nil { + defer C.g_error_free(gstError) return nil, fmt.Errorf("(pipeline error) %s", C.GoString(gstError.message)) }