From: Jihoon Kim Date: Mon, 17 Jun 2024 08:08:54 +0000 (+0900) Subject: Fix issues detected by static analysis tool X-Git-Tag: accepted/tizen/unified/20240618.195742~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cbe7079f38f3cc557b3ed45f46662b738441e19;p=platform%2Fcore%2Fuifw%2Flibscl-ui-nui.git Fix issues detected by static analysis tool The pointer returned by operator new can't be null Change-Id: I13f4004f3fc4743a83be2351a2c3b7b6ef2df4d5 Signed-off-by: Jihoon Kim --- diff --git a/scl/file_storage.cpp b/scl/file_storage.cpp index 64d5702..3bb060f 100644 --- a/scl/file_storage.cpp +++ b/scl/file_storage.cpp @@ -16,6 +16,7 @@ */ #include "file_storage_impl.h" +#include FileStorage::FileStorage(const IString_Provider* string_provider): m_storage(NULL), @@ -156,7 +157,7 @@ int FileStorage:: fclose(fp); return -1; } - m_storage = new char[size]; + m_storage = new(std::nothrow) char[size]; if (m_storage == NULL) { fclose(fp); return -1; @@ -193,7 +194,7 @@ get_storage(const FileStorage& storage, int offset, int block_size) { delete[] m_storage; } - m_storage = new char[block_size]; + m_storage = new(std::nothrow) char[block_size]; if (m_storage == NULL) { return -1; }