]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/cmdparse: fix memory leak
authorSage Weil <sage@inktank.com>
Mon, 21 Oct 2013 16:21:57 +0000 (09:21 -0700)
committerSage Weil <sage@inktank.com>
Mon, 21 Oct 2013 16:21:57 +0000 (09:21 -0700)
demangle is allocating with malloc() in this case.

Signed-off-by: Sage Weil <sage@inktank.com>
src/common/cmdparse.cc

index 16c62349c403c2be91ce1918cd85d7fe8a4852d6..3ca3bbd0cb4693a4895e73b36b7ae1e654d1c988 100644 (file)
@@ -225,4 +225,6 @@ handle_bad_get(CephContext *cct, string k, const char *tname)
   ostringstream oss;
   bt.print(oss);
   lderr(cct) << oss << dendl;
+  if (status == 0)
+    free((char *)typestr);
 }