Skip to content

Commit 26ed5e2

Browse files
authored
Inverted Boolean condition and swapped if-else branches. (#9)
Signed-off-by: Ralph Lange (CR/AEE1) <ralph.lange@de.bosch.com>
1 parent 60b5950 commit 26ed5e2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

microros_olimex_e407_extensions/Src/allocators.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ void * __freertos_reallocate(void * pointer, size_t size, void * state){
2525
// printf("-- Realloc %d -> %d (prev: %d B)\n",getBlockSize(pointer),size, xPortGetFreeHeapSize());
2626
absoluteUsedMemory += size;
2727
usedMemory += size;
28-
if (NULL != pointer){
28+
if (NULL == pointer){
29+
return pvPortMalloc(size);
30+
} else {
2931
usedMemory -= getBlockSize(pointer);
3032
return pvPortRealloc(pointer,size);
31-
} else {
32-
return pvPortMalloc(size);
3333
}
3434
}
3535

0 commit comments

Comments
 (0)