From 4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 20 Jan 2015 04:36:08 +0100 Subject: Minor fixes and tweaks suggested by cppcheck - Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru --- src/common/malloc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/common/malloc.c') diff --git a/src/common/malloc.c b/src/common/malloc.c index 43fbe4ea1..c647dc18f 100644 --- a/src/common/malloc.c +++ b/src/common/malloc.c @@ -124,8 +124,7 @@ void aFree_(void *p, const char *file, int line, const char *func) // ShowMessage("%s:%d: in func %s: aFree %p\n",file,line,func,p); if (p) FREE(p, file, line, func); - - p = NULL; + //p = NULL; } @@ -487,13 +486,13 @@ void mfree_(void *ptr, const char *file, int line, const char *func) { /* Allocating blocks */ static struct block* block_malloc(unsigned short hash) { - int i; struct block *p; if(hash_unfill[0] != NULL) { /* Space for the block has already been secured */ p = hash_unfill[0]; hash_unfill[0] = hash_unfill[0]->unfill_next; } else { + int i; /* Newly allocated space for the block */ p = (struct block*)MALLOC(sizeof(struct block) * (BLOCK_ALLOC), __FILE__, __LINE__, __func__ ); memmgr_usage_bytes_t += sizeof(struct block) * (BLOCK_ALLOC); -- cgit v1.2.3-60-g2f50