FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for libs/esl

This commit is contained in:
Andrey Volk committed 2019-07-18 21:27:04 +04:00
1 parent 939b949da4
commit f0da2f2cd4
6 files changed
+62 -78

No files matched your search

+1 -9
View File
@@ -295,10 +295,7 @@ static unsigned char* ensure(printbuffer * const p, size_t needed, const interna
return NULL;
}
if (newbuffer)
{
memcpy(newbuffer, p->buffer, p->offset + 1);
}
memcpy(newbuffer, p->buffer, p->offset + 1);
hooks->deallocate(p->buffer);
}
p->length = newsize;
@@ -890,11 +887,6 @@ fail:
hooks->deallocate(buffer->buffer);
}
if (printed != NULL)
{
hooks->deallocate(printed);
}
return NULL;
}