* checker : HANDLE_LEAK.ex
Change-Id: Id0a5dd26f503e204bdd9e710c4f007071dcbf71b
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
"File content is empty : " << location);
unsigned char *content = new unsigned char[filesize + 1];
+ if (content == NULL)
+ VcoreThrowMsg(Certificate::Exception::InternalError,
+ "Fail to allocate memory.");
+
memset(content, 0x00, filesize + 1);
rewind(fp);
return std::string();
char *temp = new char[uid->length + 1];
+
+ if(temp == NULL) {
+ LogError("Fail to allocate memory.");
+ return std::string();
+ }
+
memcpy(temp, uid->data, uid->length);
temp[uid->length] = 0;
std::string uidStr(temp);
if (fwrite(certBuffer, sizeof(char), length, fp_write) != length) {
LogError("Fail to write certificate.");
result = CERTSVC_FAIL;
+ fclose(fp_write);
goto error;
}
- fclose(fp_write);
result = certsvc_certificate_new_from_file(instance, fileName.c_str(), certificate);
if (result != CERTSVC_SUCCESS) {
LogError("Failed to construct certificate from buffer.");
+ fclose(fp_write);
goto error;
}
+ fclose(fp_write);
unlink(fileName.c_str());
}