[Mesa-dev] [PATCH] vid_enc: Fix resource leak on OMX_ErrorNone

robert.foss at collabora.com robert.foss at collabora.com
Thu Apr 21 21:49:20 UTC 2016


From: Robert Foss <robert.foss at collabora.com>

Avoid leaking buffer allocated for task if an
error has occured.

Coverity id: 1213929
Signed-off-by: Robert Foss <robert.foss at collabora.com>
---
 src/gallium/state_trackers/omx/vid_enc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/state_trackers/omx/vid_enc.c b/src/gallium/state_trackers/omx/vid_enc.c
index 4505fe1..de62166 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;
    }
 
-- 
2.5.0



More information about the mesa-dev mailing list