diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-03-31 16:45:29 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-03-31 16:43:44 +0200 |
commit | 3b25ea6d83041c03d06a47fb5e278372181b8a6d (patch) | |
tree | 5be37a4a5959bf1e73217695c1297392d68a11e6 /odk/source/unoapploader | |
parent | bf2f0c913774c90e4c9a65119d0219187bb4498c (diff) |
tdf#120703 PVS: Silence V575 warnings
V575 The potential null pointer is passed into 'foo' function
Add asserts to those cases that are related to OOM cases. There's
nothing to be done if the assertions fail anyway.
Change-Id: I92ac95d44f512aa1948b1552b0e1f6da695a9f92
Reviewed-on: https://gerrit.libreoffice.org/70008
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'odk/source/unoapploader')
-rw-r--r-- | odk/source/unoapploader/win/unoapploader.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/odk/source/unoapploader/win/unoapploader.c b/odk/source/unoapploader/win/unoapploader.c index dd5cfaf78439..455f4689adad 100644 --- a/odk/source/unoapploader/win/unoapploader.c +++ b/odk/source/unoapploader/win/unoapploader.c @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <assert.h> #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -208,6 +209,7 @@ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, if ( value != NULL ) size += wcslen( PATHSEPARATOR ) + wcslen( value ); wchar_t* envstr = (wchar_t*) malloc( size*sizeof(wchar_t) ); + assert(envstr); wcscpy( envstr, ENVVARNAME ); wcscat( envstr, L"=" ); wcscat( envstr, path ); @@ -312,6 +314,7 @@ wchar_t* createCommandLine( wchar_t const * appendix ) /* create the command line */ cmdline = (wchar_t*) malloc( (wcslen( DQUOTE ) + wcslen( cmdname ) + wcslen ( DQUOTE ) + wcslen( SPACE ) + wcslen( appendix ) + 1) * sizeof(wchar_t) ); + assert(cmdline); wcscpy( cmdline, DQUOTE ); wcscat( cmdline, cmdname ); wcscat( cmdline, DQUOTE ); |