Skip to content

Commit 3a0c2dd

Browse files
Fix double free
_fileName and _values have to be re-set to NULL, otherwise a double-free might occur.
1 parent b7bed69 commit 3a0c2dd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hal/architecture/Linux/drivers/core/SoftEeprom.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ void SoftEeprom::destroy()
9898
{
9999
if (_values) {
100100
delete[] _values;
101+
_values = NULL;
101102
}
102103
if (_fileName) {
103104
free(_fileName);
105+
_fileName = NULL;
104106
}
105107
_length = 0;
106108
}

0 commit comments

Comments
 (0)