summaryrefslogtreecommitdiff
path: root/src/common/memmgr.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-26 02:28:59 +0100
committerHaru <haru@dotalux.com>2016-05-08 19:53:57 +0200
commit2349b2a1528fe5dc41d930f8dd332df5ba521eb6 (patch)
tree3656a91a896f0ef090606b2b4c9184ad73153a3f /src/common/memmgr.c
parent58a7bf46508b7f186704e7efb39576e09f0ab866 (diff)
downloadhercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.gz
hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.bz2
hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.xz
hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.zip
Fixed various issues pointed out by cppcheck
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/memmgr.c')
-rw-r--r--src/common/memmgr.c6
1 files changed, 3 insertions, 3 deletions
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);
}