[Webkit-unassigned] [Bug 106342] [GTK][WK2] accessibility/language-attribute.html is failing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 16 02:33:39 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=106342





--- Comment #2 from Mario Sanchez Prada <mario at webkit.org>  2013-04-16 02:31:56 PST ---
(From update of attachment 197020)
View in context: https://bugs.webkit.org/attachment.cgi?id=197020&action=review

> Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:593
> +    for (GSList* textAttributes = atk_text_get_default_attributes(ATK_TEXT(m_element)); textAttributes; textAttributes = textAttributes->next) {
> +        AtkAttribute* atkAttribute = static_cast<AtkAttribute*>(textAttributes->data);
> +        if (!strcmp(atkAttribute->name, atk_text_attribute_get_name(ATK_TEXT_ATTR_LANGUAGE))) {
> +            language.set(g_strdup_printf("AXLanguage: %s", atkAttribute->value));
> +            return JSStringCreateWithUTF8CString(language.get());
> +        }
> +    }

You are leaking both the returned GSList* and the data in each of its elements here, since atk_text_get_default_attributes() is transfer-full.

So, you should use a GOwnPtr<GSList> for that least, although you would still need to make sure that both the AtkAttribute structs and the gchar* pointers inside them (name, value) are freed before returning from this function.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list