Skip to contentSkip to conversation

target-i386: Don't strdup() alias property name

PATCH Applied Eduardo Habkost 1 participant 2 messages Jul 9, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-i386: Don't strdup() alias property name

Now object_property_add_alias() calls g_strdup() on the target property name, so we don't need to call g_strdup() ourselves.

---
 target-i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/cpu.c +1 -1
index b4f9461..9cd1318 100644
@@ -3021,7 +3021,7 @@ static void x86_cpu_register_feature_bit_props(X86CPU *cpu,
 
     for (i = 1; names[i]; i++) {
         feat2prop(names[i]);
-        object_property_add_alias(obj, names[i], obj, g_strdup(names[0]),
+        object_property_add_alias(obj, names[i], obj, names[0],
                                   &error_abort);
     }
 
Signature · 1 line
2.1.0
author Applied
#1 lore raw
Quoted 4 lines · Eduardo Habkost

Now object_property_add_alias() calls g_strdup() on the target property name, so we don't need to call g_strdup() ourselves.

Applied to the x86 tree.

Signature · 1 line
Eduardo