[Mesa-stable] [PATCH] pipe-loader: Fix memory leak v2

Emil Velikov emil.l.velikov at gmail.com
Wed Aug 20 02:54:40 PDT 2014


On 20 August 2014 00:49, Tom Stellard <thomas.stellard at amd.com> wrote:
> CC: "10.2" <mesa-stable at lists.freedesktop.org>
>
> v2:
>   - Change driver_name to char*
I knew there was a reason as to why I put a comment in there.
Thanks for tracking it down Tom.

Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>

> ---
>  src/gallium/auxiliary/pipe-loader/pipe_loader.h     | 2 +-
>  src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
> index 8ff00b1..6127a6a 100644
> --- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
> +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
> @@ -67,7 +67,7 @@ struct pipe_loader_device {
>        } pci;
>     } u; /**< Discriminated by \a type */
>
> -   const char *driver_name;
> +   char *driver_name;
>     const struct pipe_loader_ops *ops;
>  };
>
> diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
> index 1bbaf19..88056f5 100644
> --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
> +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
> @@ -256,7 +256,7 @@ pipe_loader_drm_release(struct pipe_loader_device **dev)
>        util_dl_close(ddev->lib);
>
>     close(ddev->fd);
> -   /* XXX: Free ddev->base.driver_name - strdup at loader_get_driver_for_fd */
> +   FREE(ddev->base.driver_name);
>     FREE(ddev);
>     *dev = NULL;
>  }
> --
> 1.8.3.1
>


More information about the mesa-stable mailing list