fixed minor coverity warning

This commit is contained in:
Yann Collet
2016-07-13 17:25:53 +02:00
parent 158e7703bb
commit 3c174f4da9
2 changed files with 7 additions and 10 deletions
+1 -1
View File
@@ -972,7 +972,7 @@ size_t ZDICT_trainFromBuffer_unsafe(
for (u=1; u<dictList->pos; u++) {
U32 l = dictList[u].length;
ptr -= l;
if (ptr<(BYTE*)dictBuffer) return ERROR(GENERIC); /* should not happen */
if (ptr<(BYTE*)dictBuffer) { free(dictList); return ERROR(GENERIC); } /* should not happen */
memcpy(ptr, (const char*)samplesBuffer+dictList[u].pos, l);
} }