From dbafbcccfcc49b90afcf849ed55c5fdd13b2fd96 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Fri, 8 Jul 2016 10:09:32 +0200 Subject: [PATCH] msvcrt: Remove redundant NULL checks before free(). Signed-off-by: Michael Stefaniuc Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/errno.c | 2 +- dlls/msvcrt/file.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/msvcrt/errno.c b/dlls/msvcrt/errno.c index 46b1859a8e6..893ed7bf20c 100644 --- a/dlls/msvcrt/errno.c +++ b/dlls/msvcrt/errno.c @@ -365,7 +365,7 @@ void CDECL MSVCRT__wperror(const MSVCRT_wchar_t* str) } } MSVCRT_perror(buffer); - if (buffer) MSVCRT_free(buffer); + MSVCRT_free(buffer); } /********************************************************************* diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 5a2f1e65346..432d5c7e15c 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -3498,8 +3498,7 @@ int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count) if (!WriteFile(hand, q, size, &num_written, NULL)) num_written = -1; release_ioinfo(info); - if(p) - MSVCRT_free(p); + MSVCRT_free(p); if (num_written != size) { TRACE("WriteFile (fd %d, hand %p) failed-last error (%d), num_written %d\n",