summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);