Skip to content

DOM.Core.Elements.Set_Attribute memory leak #21

Description

@KsiCom
package DOM.Core.Elements is
...
   procedure Set_Attribute
     (Elem : Element; Name : DOM_String; Value : DOM_String);
   --  Set the value of a specific attribute. The attribute is created if it
   --  doesn't exist yet.
       ^^^^^^^^^^^^^^^^

But the procedure creates a new attribute every time, even if it already exists.

with DOM.Core.Documents;
with DOM.Core.Elements;

procedure XMLBug is
   Imp : DOM.Core.DOM_Implementation;
   Doc : DOM.Core.Document;
   Root : DOM.Core.Element;
begin
   Doc := DOM.Core.Create_Document (Imp);
   Root := DOM.Core.Documents.Create_Element (Doc, "data");
   loop
      DOM.Core.Elements.Set_Attribute (Root, "bug", "memory leak");
   end loop;
end XMLBug;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions