mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-24 02:59:07 +08:00
fix issue 1043
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@1116 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
parent
780183226c
commit
41bd040ef5
@ -711,6 +711,14 @@ int OpenclDevice::GeneratBinFromKernelSource( cl_program program, const char * c
|
||||
binaries[i] = (char*) malloc( sizeof(char) * binarySizes[i] );
|
||||
if ( binaries[i] == NULL )
|
||||
{
|
||||
// cleanup all memory allocated so far
|
||||
for(int cleanupIndex = 0; cleanupIndex < i; ++cleanupIndex)
|
||||
{
|
||||
free(binaries[cleanupIndex]);
|
||||
}
|
||||
// cleanup binary array
|
||||
free(binaries);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user