Skip to content

memory leak in amf_write_array #7

Description

@sneakyimp

After much gnashing of teeth, I located a problem encoding in amf_write_array. The issue was that I was freeing indexAsString before I was done using it:

                    efree(indexAsString);

I'm not sure if memory for this _char is allocated by spprintf or whether I should be approaching this in some other way. The basic idea is that I need to transform a ulong, _index* into a string. E.g., the ulong 1 becomes "1" so that I can write it as a string to the buffer. Please see code here for reference:
https://github.com/sneakyimp/amfext/blob/master/amf.c#L945

@Sean-Der any chance you could recommend how to allocate this char* and then dispose of it properly once we've encoded all the associative keys?

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions