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>
This commit is contained in:
Loic Dachary 2015-05-25 15:36:30 +02:00
parent 6ca60061bb
commit 0822922566

View File

@ -59,6 +59,7 @@ public:
}
int r = interface->init(profile);
if (r) {
delete interface;
return r;
}
*erasure_code = ErasureCodeInterfaceRef(interface);