Previous versions of this patch had whitespace damage (I expected everything
was fine, since I was using git send-email), and had a missing semicolon.

I've attached the patch, so it can escape gmail's mangling until I can
figure something else out. I'm sending this patch mostly because of the
second problem.

Third time's the charm.
From 32118149059b774f0b93146f097d91b713439491 Mon Sep 17 00:00:00 2001
From: Jesse Adkins <[email protected]>
Date: Wed, 4 Aug 2010 15:14:02 -0700
Subject: [PATCH] xfree86: Properly fix leak in OpenConfig{Dir,File}.

Fixes a leak caused by strdup without free.

Signed-off-by: Jesse Adkins <[email protected]>
---
 hw/xfree86/parser/scan.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 5312143..a266e15 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -819,6 +819,8 @@ OpenConfigFile(const char *path, const char *cmdline, const char *projroot,
 		}
 	}
 
+	free(pathcopy);
+
 	if (file) {
 		configFiles[numFiles].file = file;
 		configFiles[numFiles].path = strdup(filepath);
@@ -927,6 +929,7 @@ OpenConfigDir(const char *path, const char *cmdline, const char *projroot,
 		}
 	}
 
+	free(pathcopy);
 	return dirpath;
 }
 
-- 
1.7.0.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to