]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/PyState: fix leak if `type` is unknown
authorKefu Chai <kchai@redhat.com>
Sat, 8 Jul 2017 12:18:18 +0000 (20:18 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 8 Jul 2017 12:18:20 +0000 (20:18 +0800)
this silences a clang analyzer warning:

Potential leak of memory pointed to by 'c'

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mgr/PyState.cc

index 963526fc519d7c457f5f37f845942034d64368f6..78b0cb542321e671d87cab7e8a02b14afb4865ae 100644 (file)
@@ -172,6 +172,7 @@ ceph_send_command(PyObject *self, PyObject *args)
         c);
     return nullptr;
   } else {
+    delete c;
     string msg("unknown service type: ");
     msg.append(type);
     PyErr_SetString(PyExc_ValueError, msg.c_str());