aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/hyperscan_tools.cxx
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-02-11 12:29:10 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-02-11 12:29:10 +0000
commit41a93a39b05c8fc046299c2ac6baec7d91cb2947 (patch)
tree9594cd73304f3744a96e60bc4c6c8715319a1078 /src/libserver/hyperscan_tools.cxx
parent5c9e9f60b38a0b630d03b35efe1eadf675d2e232 (diff)
downloadrspamd-41a93a39b05c8fc046299c2ac6baec7d91cb2947.tar.gz
rspamd-41a93a39b05c8fc046299c2ac6baec7d91cb2947.zip
[Minor] Fix some warnings
Diffstat (limited to 'src/libserver/hyperscan_tools.cxx')
-rw-r--r--src/libserver/hyperscan_tools.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libserver/hyperscan_tools.cxx b/src/libserver/hyperscan_tools.cxx
index d30f11a14..cb2e15c9a 100644
--- a/src/libserver/hyperscan_tools.cxx
+++ b/src/libserver/hyperscan_tools.cxx
@@ -331,8 +331,8 @@ auto load_cached_hs_file(const char *fname, std::int64_t offset = 0) -> tl::expe
if (page_size == -1) {
page_size = 4096;
}
- posix_memalign(&buf, page_size, unserialized_size);
- if (buf == nullptr) {
+ auto errcode = posix_memalign(&buf, page_size, unserialized_size);
+ if (errcode != 0 || buf == nullptr) {
return tl::make_unexpected(error {"Cannot allocate memory", errno, error_category::CRITICAL });
}