summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Kukawka <danny.kukawka@web.de>2009-02-22 12:03:58 +0100
committerDanny Kukawka <danny.kukawka@web.de>2009-02-22 12:03:58 +0100
commite20eefbf772cfaeaafc232d390005daa316d22b9 (patch)
tree43a1ecfca4fda3918c3b2972a7b38d7c0cb4ee65
parent507a37f2159e1355de136f7a2c7807c31a8affba (diff)
Fixed commit 92e7f2e8b2a1a36d3ec2b371424719e7078d91da: don't free 'const char *'. Changed code to prevent usage of g_strdup() which prevents need to use g_free().
-rw-r--r--hald/device_info.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hald/device_info.c b/hald/device_info.c
index 6444b544..b1573510 100644
--- a/hald/device_info.c
+++ b/hald/device_info.c
@@ -829,11 +829,11 @@ handle_merge (struct rule *rule, HalDevice *d)
{
const char *value = (char *)RULES_PTR(rule->value_offset);
const char *key;
+ char key_to_merge[HAL_PATH_MAX];
if (rule->rtype == RULE_MERGE || rule->rtype == RULE_APPEND ||
rule->rtype == RULE_PREPEND || rule->rtype == RULE_ADDSET ) {
char udi_to_merge[HAL_PATH_MAX];
- char key_to_merge[HAL_PATH_MAX];
/* Resolve key paths like 'someudi/foo/bar/baz:prop.name' '@prop.here.is.an.udi:with.prop.name' */
if (!resolve_udiprop_path (rule->key, hal_device_get_udi (d),
@@ -842,7 +842,7 @@ handle_merge (struct rule *rule, HalDevice *d)
HAL_ERROR (("Could not resolve keypath '%s' on udi '%s'", rule->key, hal_device_get_udi (d)));
return FALSE;
} else {
- key = g_strdup(key_to_merge);
+ key = key_to_merge;
if (strcmp(hal_device_get_udi (d), udi_to_merge) != 0) {
@@ -852,7 +852,6 @@ handle_merge (struct rule *rule, HalDevice *d)
if (d == NULL) {
HAL_ERROR (("Could not find device with udi '%s'", udi_to_merge));
- g_free (key);
return FALSE;
}
}