st/omx: Fix resource leak on OMX_ErrorNone
authorRobert Foss <robert.foss@collabora.com>
Thu, 21 Apr 2016 21:49:20 +0000 (17:49 -0400)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 25 Apr 2016 14:09:37 +0000 (15:09 +0100)
Avoid leaking buffer allocated for task if an error has occured.

Coverity id: 1213929
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/gallium/state_trackers/omx/vid_enc.c

index 4505fe1a693d757182942025a1219f37c0270eff..de621662f45f6963d424b6543ff7951fc6212167 100644 (file)
@@ -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;
    }