summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-09-07 18:22:27 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-09-07 21:39:41 +0200
commit1bd83f0f6ad3d9fa84b4eae38b3393526e233771 (patch)
tree677255390a78488d3521983651a032a9edb79a06 /sal
parent0c05d4dc4810749e65e81e98f04805b251d61e5a (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>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/security.cxx4
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);