Avoid an unnecessary string copy in xml_attr_new_int().
authorAndrej Kacian <ticho@claws-mail.org>
Thu, 6 Sep 2018 16:43:35 +0000 (18:43 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Thu, 6 Sep 2018 16:43:35 +0000 (18:43 +0200)
src/common/xml.c

index 4127fd0..45fcd30 100644 (file)
@@ -494,10 +494,8 @@ XMLAttr *xml_attr_new_int(const gchar *name, const gint value)
 
        new_attr = g_new(XMLAttr, 1);
        new_attr->name = XML_STRING_ADD(name);
-       new_attr->value = g_strdup(valuestr);
+       new_attr->value = valuestr;
  
-       g_free(valuestr);
-
        return new_attr;
 }