8151110: libfontmanager should free memory with delete[] if it was allocated with new[]

Reviewed-by: prr, serb
This commit is contained in:
Prasanta Sadhukhan 2016-03-17 12:48:25 +05:30
parent 8147c0ae94
commit dd801fbc59

View File

@ -293,7 +293,7 @@ reference_table(hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data) {
return NULL;
}
length = env->GetArrayLength(tableBytes);
buffer = new jbyte[length];
buffer = (jbyte *)calloc(length, sizeof(jbyte));
env->GetByteArrayRegion(tableBytes, 0, length, buffer);
return hb_blob_create((const char *)buffer, length,