pipe-loader: Fix memory leak v2
authorTom Stellard <thomas.stellard@amd.com>
Tue, 19 Aug 2014 21:04:32 +0000 (14:04 -0700)
committerTom Stellard <thomas.stellard@amd.com>
Thu, 21 Aug 2014 13:12:12 +0000 (06:12 -0700)
v2:
  - Change driver_name to char*

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: "10.2" <mesa-stable@lists.freedesktop.org>
src/gallium/auxiliary/pipe-loader/pipe_loader.h
src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c

index 8ff00b1e1e1aab537adad6751e8d1176e9a908cc..6127a6ac3c06c19df538bc01a6909d127aacf144 100644 (file)
@@ -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;
 };
 
index 1bbaf190c5bb1fe888e73e3b087c22938140749b..88056f500519da88ca8a2f43e518db72093ef182 100644 (file)
@@ -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;
 }