From: Paul Floyd Date: Fri, 10 Nov 2023 06:39:00 +0000 (+0100) Subject: regtest: bug401284.c should never cast the return of malloc in C X-Git-Tag: VALGRIND_3_23_0~280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa3432229dff78dbbe95aeb0604215d3d588c4a4;p=thirdparty%2Fvalgrind.git regtest: bug401284.c should never cast the return of malloc in C --- diff --git a/memcheck/tests/bug401284.c b/memcheck/tests/bug401284.c index 704ed52f29..33151bed7d 100644 --- a/memcheck/tests/bug401284.c +++ b/memcheck/tests/bug401284.c @@ -5,7 +5,7 @@ int main(int argc, char* argv[]) { size_t len = strlen(argv[1]); - char* buf = (char*) malloc(2 * len + 1); + char* buf = malloc(2 * len + 1); memcpy(buf, argv[1], len + 1); strncat(buf + len, buf, len); printf("%s\n", buf);