From 2349b2a1528fe5dc41d930f8dd332df5ba521eb6 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 26 Dec 2015 02:28:59 +0100 Subject: Fixed various issues pointed out by cppcheck Signed-off-by: Haru --- src/common/memmgr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/common/memmgr.c') diff --git a/src/common/memmgr.c b/src/common/memmgr.c index 15e55fbeb..dfea24465 100644 --- a/src/common/memmgr.c +++ b/src/common/memmgr.c @@ -154,8 +154,8 @@ void* aReallocz_(void *p, size_t size, const char *file, int line, const char *f #ifdef USE_MEMMGR ret = REALLOC(p, size, file, line, func); #else - size_t newSize; - if (p) { + if (p != NULL) { + size_t newSize; size_t oldSize = BUFFER_SIZE(p); ret = REALLOC(p, size, file, line, func); newSize = BUFFER_SIZE(ret); @@ -167,7 +167,7 @@ void* aReallocz_(void *p, size_t size, const char *file, int line, const char *f memset(ret, 0, BUFFER_SIZE(ret)); } #endif - if (ret == NULL){ + if (ret == NULL) { ShowFatalError("%s:%d: in func %s: aRealloc error out of memory!\n",file,line,func); exit(EXIT_FAILURE); } -- cgit v1.2.3-60-g2f50