ts2phc: Fix memory leak.
Each slave creates an instance of a servo. However, when cleaning up, the code neglected to free the servo, resulting in a memory leak. This patch fixes the issue by calling the appropriate method to destroy the servo. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
278d9f45ab
commit
70c32043a5
|
@ -240,6 +240,7 @@ static void ts2phc_slave_destroy(struct ts2phc_slave *slave)
|
||||||
if (ioctl(slave->fd, PTP_EXTTS_REQUEST2, &extts)) {
|
if (ioctl(slave->fd, PTP_EXTTS_REQUEST2, &extts)) {
|
||||||
pr_err(PTP_EXTTS_REQUEST_FAILED);
|
pr_err(PTP_EXTTS_REQUEST_FAILED);
|
||||||
}
|
}
|
||||||
|
servo_destroy(slave->servo);
|
||||||
posix_clock_close(slave->clk);
|
posix_clock_close(slave->clk);
|
||||||
free(slave->name);
|
free(slave->name);
|
||||||
free(slave);
|
free(slave);
|
||||||
|
|
Loading…
Reference in New Issue