From 3b25ea6d83041c03d06a47fb5e278372181b8a6d Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 31 Mar 2019 16:45:29 +0300 Subject: 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 --- soltools/mkdepend/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'soltools') 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 #include #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, "\\"); -- cgit