python/mraa.i: Fix memory leak on python Spi::write and I2c::write
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -49,6 +49,7 @@ class I2c;
|
|||||||
{
|
{
|
||||||
// need to loop over length
|
// need to loop over length
|
||||||
$result = PyByteArray_FromStringAndSize((char*) $1, arg2);
|
$result = PyByteArray_FromStringAndSize((char*) $1, arg2);
|
||||||
|
free($1);
|
||||||
}
|
}
|
||||||
|
|
||||||
class Spi;
|
class Spi;
|
||||||
@@ -56,6 +57,7 @@ class Spi;
|
|||||||
{
|
{
|
||||||
// need to loop over length
|
// need to loop over length
|
||||||
$result = PyByteArray_FromStringAndSize((char*) $1, arg3);
|
$result = PyByteArray_FromStringAndSize((char*) $1, arg3);
|
||||||
|
free($1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user