summaryrefslogtreecommitdiff
path: root/soltools
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-03-31 16:45:29 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-03-31 16:43:44 +0200
commit3b25ea6d83041c03d06a47fb5e278372181b8a6d (patch)
tree5be37a4a5959bf1e73217695c1297392d68a11e6 /soltools
parentbf2f0c913774c90e4c9a65119d0219187bb4498c (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 'soltools')
-rw-r--r--soltools/mkdepend/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c
index 844edb390ad2..51b6c8606cc9 100644
--- a/soltools/mkdepend/main.c
+++ b/soltools/mkdepend/main.c
@@ -56,6 +56,7 @@ typedef _W64 int ssize_t;
#endif
#include "def.h"
+#include <assert.h>
#include <string.h>
#ifdef hpux
#define sigvec sigvector
@@ -522,7 +523,7 @@ void freefile(struct filepointer *fp)
char *copy(char const *str)
{
char *p = (char *)malloc(strlen(str) + 1);
-
+ assert(p); // Don't handle OOM conditions
strcpy(p, str);
return p;
}
@@ -718,6 +719,7 @@ char* append_slash(char *path)
new_string = path;
} else {
new_string = (char*)malloc(sizeof(char) * (strlen(path) + 2));
+ assert(new_string); // Don't handle OOM conditions
strcpy(new_string, path);
if (native_win_slashes)
strcat(new_string, "\\");