diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-09-07 18:22:27 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-09-07 21:39:41 +0200 |
commit | 1bd83f0f6ad3d9fa84b4eae38b3393526e233771 (patch) | |
tree | 677255390a78488d3521983651a032a9edb79a06 | |
parent | 0c05d4dc4810749e65e81e98f04805b251d61e5a (diff) |
Be careful with failed realloc
Change-Id: I809e70487b9174ae902d3a11cc2845ec310d009f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139610
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | sal/osl/unx/security.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx index f541c90001b3..1b1f16a54edc 100644 --- a/sal/osl/unx/security.cxx +++ b/sal/osl/unx/security.cxx @@ -105,7 +105,9 @@ static oslSecurityImpl * growSecurityImpl( n = std::numeric_limits<std::size_t>::max(); } p = static_cast<oslSecurityImpl *>(realloc(impl, n)); - memset (p, 0, n); + if (p != nullptr) { + memset (p, 0, n); + } } if (p == nullptr) { free(impl); |