egl/dri2: do not leak dri2_dpy->driver_name
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 2 Jun 2014 11:26:17 +0000 (12:26 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 9 Jun 2014 21:56:00 +0000 (22:56 +0100)
commit5cb1cad0aef8d1c426207c955996278290e19e60
tree9d977e87d776e61fa8ef84aa880c1db5b5536d90
parentc153b1f39b60f7a2ba59262b12b4597cbfbf36ca
egl/dri2: do not leak dri2_dpy->driver_name

Originally all hardware drivers duplicate the driver_name string
from an external source, while for the software rasterizer we set
it to "swrast". Follow the example set by hw drivers this way
we can free the string at dri2_terminate().

v2: Use strdup over strndup. Suggested by Ilia Mirkin.
v3: Handle platform_drm in a similar manner. Cleanup swrast
driver_name in error path.

Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/platform_drm.c
src/egl/drivers/dri2/platform_x11.c