[PATCH 3/5] scanner: Plug memory leak in end_element()

Martin Olsson martin at minimum.se
Mon Jul 9 02:35:55 PDT 2012


---
 src/scanner.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/scanner.c b/src/scanner.c
index 4d4537c..0076d92 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -462,7 +462,7 @@ end_element(void *data, const XML_Char *name)
 		char *text = strndup(ctx->character_data,
 				     ctx->character_data_length);
 		if (text)
-			ctx->description->text = strdup(text);
+			ctx->description->text = text;
 		ctx->description = NULL;
 	} else if (strcmp(name, "request") == 0 ||
 		   strcmp(name, "event") == 0) {
-- 
1.7.9.5



More information about the wayland-devel mailing list