Commit 1628a5c6 authored by Edgar Hucek's avatar Edgar Hucek Committed by Xiang, Haihao

libva: fix memeory leaks in libva

Signed-off-by: default avatarEdgar Hucek <gimli@dark-green.com>
Signed-off-by: default avatarXiang, Haihao <haihao.xiang@intel.com>
parent 942eedcb
......@@ -193,6 +193,9 @@ isDRI2Connected(VADriverContextP ctx, char **driver_name)
dri_state->close = dri2Close;
gsDRI2SwapAvailable = (minor >= 2);
if (device_name)
Xfree(device_name);
return True;
err_out:
......
......@@ -54,9 +54,18 @@ static void va_DisplayContextDestroy (
VADisplayContextP pDisplayContext
)
{
VADriverContextP ctx;
struct dri_state *dri_state;
if (pDisplayContext == NULL)
return;
ctx = pDisplayContext->pDriverContext;
dri_state = ctx->dri_state;
if (dri_state)
dri_state->close(ctx);
free(pDisplayContext->pDriverContext->dri_state);
free(pDisplayContext->pDriverContext);
free(pDisplayContext);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment