HomeFreeBSD

Fix memory leak in function add_config()

Description

Fix memory leak in function add_config()

Config of a hot spare or l2cache device will leak memory in function
add_config(). At the start of this function, when dealing with a
config which belongs to a hot spare not currently in use or a l2cache
device the config should be freed.

Signed-off-by: liaoyuxiangqin <guo.yong33@zte.com.cn>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4910

Details

Provenance
liaoyuxiangqin <guo.yong33@zte.com.cn>Authored on Jul 30 2016, 3:03 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Aug 1 2016, 7:49 PM
Parents
rGdf053d67a9c0: ztest: memory leaks reported by AddressSanitizer
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGe24e62a948e1: Fix memory leak in function add_config() (authored by liaoyuxiangqin <guo.yong33@zte.com.cn>).Aug 1 2016, 7:49 PM