#26078 closed defect (fixed)

CID 1435546: Error handling issues (CHECKED_RETURN)

Reported by: asn Owned by:
Priority: Medium Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: coverity tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Got a new coverity report today:

*** CID 1435546:  Error handling issues  (CHECKED_RETURN)
/src/common/compat_libevent.c: 286 in periodic_timer_disable()
280      * If the timer is already disabled, this function does nothing.
281      */
282     void
283     periodic_timer_disable(periodic_timer_t *timer)
284     {
285       tor_assert(timer);
>>>     CID 1435546:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "event_del" without checking return value (as is done elsewhere 4 out of 5 times).
286       event_del(timer->ev);
287     }
289     /** Stop and free a periodic timer */
290     void
291     periodic_timer_free_(periodic_timer_t *timer)

Seems to be related to #26063.

Child Tickets

Change History (2)

comment:1 Changed 19 months ago by asn

Status: newneeds_review

I have trivial patch that (voids) the retval of event_del in my bug26078.
I did that because that's also what we do in mainloop_event_cancel().

I don't think there is much to do apart from that, the only alternative is to issue a warn. Let me know if you'd like me to do that.

comment:2 Changed 19 months ago by nickm

Resolution: fixed
Status: needs_reviewclosed


Note: See TracTickets for help on using tickets.