Skip to content

Commit 341607e

Browse files
Free allocated buffer in Linux pure i2c block transfer function
1 parent 46d8ca7 commit 341607e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

i2c_smbus/i2c_smbus_linux.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ s32 i2c_smbus_linux::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
5656
memcpy(data, &msg.buf, *size);
5757
}
5858

59+
free(msg.buf);
60+
5961
return ret_val;
6062
}
6163

0 commit comments

Comments
 (0)