[PATCH 03/11] config/hal: don't leak the input.tags property
Dan Nicholson
dbn.lists at gmail.com
Thu May 20 07:09:05 PDT 2010
From: Julien Cristau <jcristau at debian.org>
Signed-off-by: Julien Cristau <jcristau at debian.org>
Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
---
config/hal.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/config/hal.c b/config/hal.c
index 33864c5..3b4bfd6 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -130,7 +130,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
{
char *path = NULL, *driver = NULL, *name = NULL, *config_info = NULL;
char **tags = NULL;
- char *vendor = NULL;
+ char *vendor = NULL, *hal_tags;
InputOption *options = NULL, *tmpo = NULL;
InputAttributes attrs = {0};
DeviceIntPtr dev = NULL;
@@ -166,8 +166,10 @@ device_added(LibHalContext *hal_ctx, const char *udi)
attrs.product = name;
attrs.vendor = vendor = get_prop_string(hal_ctx, udi, "info.vendor");
- tags = xstrtokenize(get_prop_string(hal_ctx, udi, "input.tags"), ",");
+ hal_tags = get_prop_string(hal_ctx, udi, "input.tags");
+ tags = xstrtokenize(hal_tags, ",");
attrs.tags = (const char * const *)tags;
+ free(hal_tags);
if (libhal_device_query_capability(hal_ctx, udi, "input.keys", NULL))
attrs.flags |= ATTR_KEYBOARD;
--
1.6.6.1
More information about the xorg-devel
mailing list