Cppcheck: Fixed all issues in rtengine/ alignedbuffer.h, colortemp.cc, dcrop.cc, simpleprocess.cc

This commit is contained in:
heckflosse
2016-10-03 21:17:27 +02:00
parent 260cd290fb
commit 01048ee513
4 changed files with 58 additions and 63 deletions

View File

@@ -93,7 +93,15 @@ public:
// we're freeing the memory and allocate it again if the new size is bigger.
if (allocatedSize < oldAllocatedSize) {
real = realloc(real, allocatedSize + alignment);
void *temp = realloc(real, allocatedSize + alignment);
if (temp) { // realloc succeeded
real = temp;
} else { // realloc failed => free old buffer and allocate new one
if (real) {
free (real);
}
real = malloc(allocatedSize + alignment);
}
} else {
if (real) {
free (real);