From: Robert Foss Date: Thu, 21 Apr 2016 21:49:20 +0000 (-0400) Subject: st/omx: Fix resource leak on OMX_ErrorNone X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b87856d25d1be1953dea30814994fc40cac5e573;p=mesa.git st/omx: Fix resource leak on OMX_ErrorNone Avoid leaking buffer allocated for task if an error has occured. Coverity id: 1213929 Signed-off-by: Robert Foss Reviewed-by: Emil Velikov --- diff --git a/src/gallium/state_trackers/omx/vid_enc.c b/src/gallium/state_trackers/omx/vid_enc.c index 4505fe1a693..de621662f45 100644 --- a/src/gallium/state_trackers/omx/vid_enc.c +++ b/src/gallium/state_trackers/omx/vid_enc.c @@ -1152,6 +1152,7 @@ static OMX_ERRORTYPE vid_enc_EncodeFrame(omx_base_PortType *port, OMX_BUFFERHEAD /* ------- load input image into video buffer ---- */ err = enc_LoadImage(port, buf, task->buf); if (err != OMX_ErrorNone) + FREE(task); return err; }