diff --git a/src/file.cpp b/src/file.cpp index 4935c4007..56c0acfbf 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -786,7 +786,6 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER { { std::size_t const buf_size = aux::numeric_cast(bufs_size(bufs)); char* buf = new char[buf_size]; - if (!buf) return false; tmp = { buf, buf_size }; bufs = span(tmp); return true; @@ -804,7 +803,6 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER { { std::size_t const buf_size = aux::numeric_cast(bufs_size(bufs)); char* buf = new char[buf_size]; - if (!buf) return false; gather_copy(bufs, buf); tmp = { buf, buf_size }; bufs = span(tmp); diff --git a/src/string_util.cpp b/src/string_util.cpp index 11a85ad1e..6deed5a37 100644 --- a/src/string_util.cpp +++ b/src/string_util.cpp @@ -166,7 +166,6 @@ namespace libtorrent { if (str == nullptr) return nullptr; std::size_t const len = std::strlen(str); char* tmp = new char[len + 1]; - if (tmp == nullptr) return nullptr; std::copy(str, str + len, tmp); tmp[len] = '\0'; return tmp;