]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
config: don't leak buf on dump config
authorSage Weil <sage@inktank.com>
Fri, 28 Sep 2012 01:15:11 +0000 (18:15 -0700)
committerSage Weil <sage@inktank.com>
Fri, 28 Sep 2012 20:18:04 +0000 (13:18 -0700)
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 <sage@inktank.com>
src/common/config.cc

index c7440028442473ab78e54bffb6ade16b3d05f431..205a15e509eb23bed390cd53ee71f38826eee6bb 100644 (file)
@@ -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);
   }
 }