summaryrefslogtreecommitdiff
path: root/sal/osl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-11-29 11:33:08 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-11-29 11:33:08 +0100
commit5bda4c35c2224946ad3a224b09f82b0013bf887f (patch)
tree26adb81206a705be87239575a646c03a372415cf /sal/osl
parentf108d9f088127050c641b1dd119d54179f4371e3 (diff)
Don't change ustrHostname in case of error
Change-Id: I78e85db2794b01286be49e1be70b53ac4f058cbe
Diffstat (limited to 'sal/osl')
-rw-r--r--sal/osl/unx/socket.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index a2b36ad5985e..23c8a2a6ff5a 100644
--- a/sal/osl/unx/socket.cxx
+++ b/sal/osl/unx/socket.cxx
@@ -1227,8 +1227,10 @@ oslSocketResult SAL_CALL osl_getHostnameOfSocketAddr(oslSocketAddr Addr, rtl_uSt
pszHostname[0] = '\0';
Result = osl_psz_getHostnameOfSocketAddr(Addr,pszHostname,sizeof(pszHostname));
-
- rtl_uString_newFromAscii(ustrHostname,pszHostname);
+ if (Result == osl_Socket_Ok)
+ {
+ rtl_uString_newFromAscii(ustrHostname,pszHostname);
+ }
return Result;
}