Bug 201731 - usr/src/sys/arm/samsung/exynos/chrome_ec.c:160: memory leaks ?
Summary: usr/src/sys/arm/samsung/exynos/chrome_ec.c:160: memory leaks ?
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 10.2-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-21 07:27 UTC by David Binderman
Modified: 2015-07-21 07:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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);