[Problem] There was a svace alert for the resource leak
[Solution] Fixup like what the previous patch did
* This and previous patch is not possible to happen
However, for the safe-coding, applies this patch too
Change-Id: I44d86a280d184287f6025e763b8d2d2a55cedcdf
Signed-off-by: Sung-jae Park <nicesj.park@samsung.com>
}
if (opid == CRYPTO_OP::ENCRYPT && sslConfig.enableBase64 == true) {
- char *_output;
- int _outputSize;
+ char *_output = nullptr;
+ int _outputSize = 0;
ret = EncodeBase64(_output, _outputSize, static_cast<unsigned char *>(out), outlen);
free(out);
out = nullptr;
break;
} else if (_output == nullptr || _outputSize <= 0) {
ErrPrint("Invalid encoded data");
+ free(_output);
delete output;
output = nullptr;
ret = -EINVAL;