[Libreoffice-commits] .: sal/osl
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Nov 1 02:59:38 PDT 2010
sal/osl/os2/socket.c | 7 +++++--
sal/osl/unx/socket.c | 6 +++++-
2 files changed, 10 insertions(+), 3 deletions(-)
New commits:
commit 64c405697b5240b8c68fa398f93e09b7d6e6b16f
Author: Gert Faller <gertfaller at aliceadsl.fr>
Date: Mon Nov 1 09:38:06 2010 +0000
fix cppcheck realloc warning
diff --git a/sal/osl/os2/socket.c b/sal/osl/os2/socket.c
index ca2bbf9..cb85368 100644
--- a/sal/osl/os2/socket.c
+++ b/sal/osl/os2/socket.c
@@ -917,12 +917,15 @@ static sal_Char* _osl_getFullQualifiedDomainName (const sal_Char *pHostName)
* full qualified name to the unqualified host name */
if ( !bHostsAreEqual )
{
+ sal_Char *pTmp;
+
OSL_TRACE("_osl_getFullQualifiedDomainName: "
"suspect FQDN: %s\n", pFullQualifiedName);
-
pFullQualifiedName[ nLengthOfHostName ] = '\0';
- pFullQualifiedName = (sal_Char*)realloc ( pFullQualifiedName,
+ pTmp = (sal_Char*)realloc ( pFullQualifiedName,
(nLengthOfHostName + 1) * sizeof( sal_Char ));
+ if (pTmp)
+ pFullQualifiedName = pTmp;
}
}
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c
index 0c42709..21ca9b6 100644
--- a/sal/osl/unx/socket.c
+++ b/sal/osl/unx/socket.c
@@ -958,12 +958,16 @@ static sal_Char* _osl_getFullQualifiedDomainName (const sal_Char *pHostName)
* full qualified name to the unqualified host name */
if ( !bHostsAreEqual )
{
+ sal_Char *pTmp;
+
OSL_TRACE("_osl_getFullQualifiedDomainName: "
"suspect FQDN: %s\n", pFullQualifiedName);
pFullQualifiedName[ nLengthOfHostName ] = '\0';
- pFullQualifiedName = (sal_Char*)realloc ( pFullQualifiedName,
+ pTmp = (sal_Char*)realloc ( pFullQualifiedName,
(nLengthOfHostName + 1) * sizeof( sal_Char ));
+ if (pTmp)
+ pFullQualifiedName = pTmp;
}
}
More information about the Libreoffice-commits
mailing list