mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
Fix memory leak: Contained watchdog not being deleted with POSIX timer deleted
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@756 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
*
|
||||
********************************************************************************/
|
||||
|
||||
static void timer_free(struct posix_timer_s *timer)
|
||||
static inline void timer_free(struct posix_timer_s *timer)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
@@ -137,10 +137,12 @@ int timer_delete(timer_t timerid)
|
||||
*get_errno_ptr() = EINVAL;
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/* Disarm the timer */
|
||||
|
||||
(void)wd_cancel(timer->pt_wdog);
|
||||
|
||||
/* Free the underlying watchdog instance (the timer will be canceled by the
|
||||
* watchdog logic before it is actually deleted)
|
||||
*/
|
||||
|
||||
(void)wd_delete(timer->pt_wdog);
|
||||
|
||||
/* Release the timer structure */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user