diff options
author | Loic Dachary <ldachary@redhat.com> | 2015-05-25 15:36:30 +0200 |
---|---|---|
committer | Loic Dachary <ldachary@redhat.com> | 2015-05-25 16:59:02 +0200 |
commit | 0822922566e0bc67741a59933d2c9fc150e75d31 (patch) | |
tree | 4f33df17f5fea1ea7f5cfceb241071318ce11547 /src/erasure-code/shec | |
parent | erasure-code: lrc size test depends on layer semantic (diff) | |
download | ceph-0822922566e0bc67741a59933d2c9fc150e75d31.tar.xz ceph-0822922566e0bc67741a59933d2c9fc150e75d31.zip |
erasure-code: do not leak shec instance on failure
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>
Diffstat (limited to 'src/erasure-code/shec')
-rw-r--r-- | src/erasure-code/shec/ErasureCodePluginShec.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/erasure-code/shec/ErasureCodePluginShec.cc b/src/erasure-code/shec/ErasureCodePluginShec.cc index 104846a197f..407c3241cc4 100644 --- a/src/erasure-code/shec/ErasureCodePluginShec.cc +++ b/src/erasure-code/shec/ErasureCodePluginShec.cc @@ -59,6 +59,7 @@ public: } int r = interface->init(profile); if (r) { + delete interface; return r; } *erasure_code = ErasureCodeInterfaceRef(interface); |