diff options
author | José Guilherme Vanz <vanz@libreoffice.org> | 2013-11-02 17:49:16 -0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-01 10:01:25 -0600 |
commit | f6141d884b7a89a856a34dc93991dbe01ded0b6b (patch) | |
tree | 8924ae1f516e282d69a303baabc2dc8541b9bd31 /sal | |
parent | 8792ec7b2129650777b7b4bfacaa7c13d923279b (diff) |
fdo#71043 - Use STACK lint tool to clean code
The code is using a pointer without check if it is not null.
Change-Id: Icb2dcf8d41a35514e18a5881f59399951b3e0493
Reviewed-on: https://gerrit.libreoffice.org/6529
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/pipe.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sal/osl/unx/pipe.c b/sal/osl/unx/pipe.c index e271e943900d..79e847e90bfb 100644 --- a/sal/osl/unx/pipe.c +++ b/sal/osl/unx/pipe.c @@ -98,6 +98,8 @@ oslPipe __osl_createPipeImpl() oslPipe pPipeImpl; pPipeImpl = (oslPipe)calloc(1, sizeof(struct oslPipeImpl)); + if (pPipeImpl == NULL) + return NULL; pPipeImpl->m_nRefCount =1; pPipeImpl->m_bClosed = sal_False; #if defined(LINUX) @@ -230,7 +232,13 @@ oslPipe SAL_CALL osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions } /* alloc memory */ - pPipe= __osl_createPipeImpl(); + pPipe = __osl_createPipeImpl(); + + if (pPipe == NULL) + { + OSL_TRACE("__osl_createPipe socket failed"); + return NULL; + } /* create socket */ pPipe->m_Socket = socket(AF_UNIX, SOCK_STREAM, 0); @@ -467,7 +475,7 @@ oslPipe SAL_CALL osl_acceptPipe(oslPipe pPipe) else { /* alloc memory */ - pAcceptedPipe= __osl_createPipeImpl(); + pAcceptedPipe = __osl_createPipeImpl(); OSL_ASSERT(pAcceptedPipe); if(pAcceptedPipe==NULL) |