]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: do not leak shec instance on failure
authorLoic Dachary <ldachary@redhat.com>
Mon, 25 May 2015 13:36:30 +0000 (15:36 +0200)
committerLoic Dachary <ldachary@redhat.com>
Mon, 25 May 2015 14:59:02 +0000 (16:59 +0200)
If the shec plugin fails to initialize the instance, it must be deleted
before returning to the caller, otherwise it will be leaked.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/erasure-code/shec/ErasureCodePluginShec.cc

index 104846a197f1839e8dc8e3b2962f24261573d932..407c3241cc4772c7952420742f046a63265ebf1a 100644 (file)
@@ -59,6 +59,7 @@ public:
     }
     int r = interface->init(profile);
     if (r) {
+      delete interface;
       return r;
     }
     *erasure_code = ErasureCodeInterfaceRef(interface);