[PATCH] config/hal: really pass xkb_rules, plug leak on xkb_variant and remove NULL checks on xfree()
Bernardo Innocenti
bernie at codewiz.org
Mon Oct 1 13:34:43 PDT 2007
Signed-off-by: Bernardo Innocenti <bernie at codewiz.org>
---
config/hal.c | 27 +++++++++++----------------
1 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/config/hal.c b/config/hal.c
index d7835e6..3479be9 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -219,6 +219,8 @@ device_added(LibHalContext *hal_ctx, const char *udi)
goto unwind;
sprintf(config_info, "hal:%s", udi);
+ if (xkb_rules)
+ add_option(&options, "xkb_rules", xkb_rules);
if (xkb_model)
add_option(&options, "xkb_model", xkb_model);
if (xkb_layout)
@@ -237,22 +239,15 @@ device_added(LibHalContext *hal_ctx, const char *udi)
dev->config_info = xstrdup(config_info);
unwind:
- if (path)
- xfree(path);
- if (driver)
- xfree(driver);
- if (name)
- xfree(name);
- if (xkb_rules)
- xfree(xkb_rules);
- if (xkb_model)
- xfree(xkb_model);
- if (xkb_layout)
- xfree(xkb_layout);
- if (xkb_options)
- xfree(xkb_options);
- if (config_info)
- xfree(config_info);
+ xfree(path);
+ xfree(driver);
+ xfree(name);
+ xfree(xkb_rules);
+ xfree(xkb_model);
+ xfree(xkb_layout);
+ xfree(xkb_variant);
+ xfree(xkb_options);
+ xfree(config_info);
out_error:
dbus_error_free(&error);
--
1.5.2.4
More information about the xorg
mailing list