Bug 201731

Summary: usr/src/sys/arm/samsung/exynos/chrome_ec.c:160: memory leaks ?
Product: Base System Reporter: David Binderman <dcb314>
Component: miscAssignee: freebsd-bugs mailing list <bugs>
Status: New ---    
Severity: Affects Some People    
Priority: ---    
Version: 10.2-STABLE   
Hardware: Any   
OS: Any   

Description David Binderman 2015-07-21 07:27:06 UTC
[usr/src/sys/arm/samsung/exynos/chrome_ec.c:160]: (error) Memory leak: msg_dout
[usr/src/sys/arm/samsung/exynos/chrome_ec.c:160]: (error) Memory leak: msg_dinp

Source code is

    msg_dout = malloc(dout_len + 4, M_DEVBUF, M_NOWAIT);
    msg_dinp = malloc(dinp_len + 4, M_DEVBUF, M_NOWAIT);

    if (ec_sc == NULL)
        return (-1);

Maybe better code

    if (ec_sc == NULL)
        return (-1);

    msg_dout = malloc(dout_len + 4, M_DEVBUF, M_NOWAIT);
    msg_dinp = malloc(dinp_len + 4, M_DEVBUF, M_NOWAIT);