Skip to content

Commit

Permalink
Scan-build: Fix false positive Memory error Use-after-free libsofia-s…
Browse files Browse the repository at this point in the history
…ip-ua/su/su_timer.c timers_is_full (freeswitch#136)
  • Loading branch information
andywolk authored Jun 23, 2022
1 parent 5f73258 commit 7e51071
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libsofia-sip-ua/su/su_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ su_timer_set0(su_timer_queue_t *timers,
su_duration_t offset)
{
int retval;
int res;

if (timers == NULL)
return -1;
Expand All @@ -240,7 +241,8 @@ su_timer_set0(su_timer_queue_t *timers,
t->sut_when = su_time_add(when, offset);

if (timers_is_full(timers[0])) {
timers_resize(NULL, timers, 0);
res = timers_resize(NULL, timers, 0);
assert(res == 0);
assert(!timers_is_full(timers[0]));
if (timers_is_full(timers[0]))
return -1;
Expand Down

0 comments on commit 7e51071

Please sign in to comment.