diff mbox

[FFmpeg-devel] lavu/hwcontext_qsv: fix the memory leak

Message ID 20190726080024.32350-1-linjie.fu@intel.com
State Accepted
Commit b3b7523feb5acbe1a3376104616fca389e1aaeca
Headers show

Commit Message

Fu, Linjie July 26, 2019, 8 a.m. UTC
av_dict_free child_device_opts to fix the memory leak.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
---
 libavutil/hwcontext_qsv.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Zhong Li July 30, 2019, 7:25 a.m. UTC | #1
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf

> Of Linjie Fu

> Sent: Friday, July 26, 2019 4:00 PM

> To: ffmpeg-devel@ffmpeg.org

> Cc: Fu, Linjie <linjie.fu@intel.com>

> Subject: [FFmpeg-devel] [PATCH] lavu/hwcontext_qsv: fix the memory leak

> 

> av_dict_free child_device_opts to fix the memory leak.

> 

> Signed-off-by: Linjie Fu <linjie.fu@intel.com>

> ---

>  libavutil/hwcontext_qsv.c | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index

> 59e4ed9157..0329a81ec3 100644

> --- a/libavutil/hwcontext_qsv.c

> +++ b/libavutil/hwcontext_qsv.c

> @@ -1240,6 +1240,8 @@ static int qsv_device_create(AVHWDeviceContext

> *ctx, const char *device,

> 

>      ret = av_hwdevice_ctx_create(&priv->child_device_ctx,

> child_device_type,

>                                   e ? e->value : NULL,

> child_device_opts, 0);

> +

> +    av_dict_free(&child_device_opts);

>      if (ret < 0)

>          return ret;

> 

> --

> 2.17.1


LTGM,applied.
diff mbox

Patch

diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
index 59e4ed9157..0329a81ec3 100644
--- a/libavutil/hwcontext_qsv.c
+++ b/libavutil/hwcontext_qsv.c
@@ -1240,6 +1240,8 @@  static int qsv_device_create(AVHWDeviceContext *ctx, const char *device,
 
     ret = av_hwdevice_ctx_create(&priv->child_device_ctx, child_device_type,
                                  e ? e->value : NULL, child_device_opts, 0);
+
+    av_dict_free(&child_device_opts);
     if (ret < 0)
         return ret;