Skip to content

memory leak [imported] #784

Closed
Closed
@cmaglie

Description

@cmaglie

This is Issue 784 moved from a Google Code project.
Added by 2012-01-10T08:26:14.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium

Original description

In

FirmataClass::setFirmwareNameAndVersion(const char *name, byte major, byte minor)

is a

firmwareVersionVector = (byte *) malloc(firmwareVersionCount);

There should be a corresponding free()

in a (to be created) destructor:

FirmataClass::~FirmataClass()
{
if(firmwareVersionVector)
free(firmwareVersionVector);
}

The contructor should get a
firmwareVersionVector = 0;

and / or
the line could go:

if(firmwareVersionCount)
  • Sebastian Haase

Metadata

Metadata

Assignees

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