From: Tom Stellard Date: Tue, 19 Aug 2014 21:04:32 +0000 (-0700) Subject: pipe-loader: Fix memory leak v2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43d954342e02a2bd719e543d567fd6c43b3e5367;p=mesa.git pipe-loader: Fix memory leak v2 v2: - Change driver_name to char* Reviewed-by: Emil Velikov CC: "10.2" --- diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h index 8ff00b1e1e1..6127a6ac3c0 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 1bbaf190c5b..88056f50051 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; }