ubus: ubus_free: clear pending timers before freeing context
authorAbhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
Tue, 3 Jan 2017 06:07:05 +0000 (11:37 +0530)
committerFelix Fietkau <nbd@nbd.name>
Wed, 4 Jan 2017 21:02:43 +0000 (22:02 +0100)
commitad5333a73b222e95458e05d52f349194df9ae7c6
tree40d00e66fbbbc3ed00f008ca2f1963b92aa86293
parentd5fabacba1f701cab27bbee907d7c4a2ab74cb4d
ubus: ubus_free: clear pending timers before freeing context

If a synchronous operation is executed on a ubus context after
uloop_done() has been called, the context's pending_timer
may remain in uloop's list of timeouts.
This leads to undefined behaviour during next execution of uloop
code, as it may be referring to unavailable memory or memory
that has been allocated for different purposes.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
libubus.c