Use malloc for Nan::NewBuffer owned data

GC results in free() rather than delete[]

Add plenty of new valgrind suppressions
This commit is contained in:
Lovell Fuller
2015-08-24 16:14:49 +01:00
parent b7e0a6f277
commit 4e67a5025a
4 changed files with 166 additions and 7 deletions

View File

@@ -142,7 +142,7 @@ class MetadataWorker : public AsyncWorker {
size_t exifLength;
if (!vips_image_get_blob(image, VIPS_META_EXIF_NAME, &exif, &exifLength)) {
baton->exifLength = exifLength;
baton->exif = new char[exifLength];
baton->exif = static_cast<char*>(malloc(exifLength));
memcpy(baton->exif, exif, exifLength);
}
}
@@ -152,7 +152,7 @@ class MetadataWorker : public AsyncWorker {
size_t iccLength;
if (!vips_image_get_blob(image, VIPS_META_ICC_NAME, &icc, &iccLength)) {
baton->iccLength = iccLength;
baton->icc = new char[iccLength];
baton->icc = static_cast<char*>(malloc(iccLength));
memcpy(baton->icc, icc, iccLength);
}
}