Skip to content

Commit

Permalink
core: avoid accessing freed structure in case of duplicated listen ad…
Browse files Browse the repository at this point in the history
…dresses

(cherry picked from commit dbd52da)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent 571bba6 commit e070571
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/socket_info.c
Expand Up @@ -1597,7 +1597,7 @@ static int fix_socket_list(struct socket_info **list, int* type_flags)
ail=ail_next;
continue;
}
/* 2. check if the extra addresses contain a duplicates for
/* 2. check if the extra addresses contain a duplicates for
* other addresses in the same list */
for (tmp_ail=ail->next; tmp_ail;){
tmp_ail_next=tmp_ail->next;
Expand All @@ -1614,6 +1614,9 @@ static int fix_socket_list(struct socket_info **list, int* type_flags)
si->port_no, si->proto);
/* remove tmp_ail*/
addr_info_listrm(&si->addr_info_lst, tmp_ail);
if(ail_next==tmp_ail) {
ail_next = tmp_ail_next;
}
free_addr_info(tmp_ail);
}
tmp_ail=tmp_ail_next;
Expand Down

0 comments on commit e070571

Please sign in to comment.