From 94547b2d1448232ae316c228d65482cc0b646ac2 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Mon, 7 Jun 2010 20:39:48 -0700 Subject: config/hal: don't leak the input.tags property Signed-off-by: Julien Cristau Reviewed-by: Dan Nicholson Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- config/hal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/hal.c b/config/hal.c index 5938d4e24..b5a350f59 100644 --- a/config/hal.c +++ b/config/hal.c @@ -129,6 +129,7 @@ static void device_added(LibHalContext *hal_ctx, const char *udi) { char *path = NULL, *driver = NULL, *name = NULL, *config_info = NULL; + char *hal_tags; InputOption *options = NULL, *tmpo = NULL; InputAttributes attrs = {0}; DeviceIntPtr dev = NULL; @@ -164,7 +165,9 @@ device_added(LibHalContext *hal_ctx, const char *udi) attrs.product = xstrdup(name); attrs.vendor = get_prop_string(hal_ctx, udi, "info.vendor"); - attrs.tags = xstrtokenize(get_prop_string(hal_ctx, udi, "input.tags"), ","); + hal_tags = get_prop_string(hal_ctx, udi, "input.tags"); + attrs.tags = xstrtokenize(hal_tags, ","); + free(hal_tags); if (libhal_device_query_capability(hal_ctx, udi, "input.keys", NULL)) attrs.flags |= ATTR_KEYBOARD; -- cgit v1.2.3