From 6f897659adc33da2c82d307681c5856ebea9af53 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 27 Sep 2012 18:15:11 -0700 Subject: [PATCH] config: don't leak buf on dump config CID 717074: Resource leak (RESOURCE_LEAK) At (26): Variable "buf" going out of scope leaks the storage it points to. Signed-off-by: Sage Weil --- src/common/config.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/config.cc b/src/common/config.cc index c744002844247..205a15e509eb2 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -326,6 +326,7 @@ void md_config_t::_show_config(std::ostream *out, Formatter *f) *out << opt->name << " = " << buf << std::endl; if (f) f->dump_string(opt->name, buf); + free(buf); } } -- 2.39.5