VirtualBox

Changeset 85082 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jul 7, 2020 2:04:23 PM (5 years ago)
Author:
vboxsync
Message:

icmp_input: don't keep a mbuf reference after we pass it to a function
that consumes it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/ip_icmp.c

    r82968 r85082  
    487487                ip->ip_src.s_addr = dst;
    488488                icmp_reflect(pData, m);
     489                m = NULL;       /* m was consumed and freed */
    489490                goto done;
    490491            }
     
    550551                    {
    551552                        icmp_attach(pData, m);
    552                         /* don't let m_freem at the end free atached buffer */
     553                        m = NULL; /* m was stashed away for safekeeping */
    553554                        goto done;
    554555                    }
     
    562563                    }
    563564                    icmp_error(pData, m, ICMP_UNREACH, ICMP_UNREACH_NET, 0, strerror(errno));
     565                    m = NULL;   /* m was consumed and freed */
     566                    goto done;
    564567                }
    565568            }
     
    585588
    586589end_error_free_m:
    587     m_freem(pData, m);
     590    if (m != NULL)
     591        m_freem(pData, m);
    588592
    589593done:
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette