From e6531ae9d5bdd37775e921268366fb76056e22d5 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Thu, 24 Jun 2010 18:45:10 +0100 Subject: [PATCH] Xephyr: fix memory leak in XF86DRIOpenConnection The allocated bus id string was not being freed. Signed-off-by: Julien Cristau Reviewed-by: Jamey Sharp Signed-off-by: Keith Packard --- hw/kdrive/ephyr/ephyrdriext.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c index 4041bf5fa..ce584b051 100644 --- a/hw/kdrive/ephyr/ephyrdriext.c +++ b/hw/kdrive/ephyr/ephyrdriext.c @@ -682,7 +682,7 @@ ProcXF86DRIOpenConnection (register ClientPtr client) { xXF86DRIOpenConnectionReply rep; drm_handle_t hSAREA; - char* busIdString; + char* busIdString = NULL; REQUEST(xXF86DRIOpenConnectionReq); REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq); @@ -716,6 +716,7 @@ ProcXF86DRIOpenConnection (register ClientPtr client) WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep); if (rep.busIdStringLength) WriteToClient(client, rep.busIdStringLength, busIdString); + free(busIdString); EPHYR_LOG ("leave\n") ; return Success; }