Bug 1168480 - Fix potential leaks in qcms_transform_create. r=seth

This commit is contained in:
David Major 2015-05-26 22:18:55 -04:00
parent c1f2a14b75
commit 78f25cd720

View File

@ -1220,7 +1220,7 @@ qcms_transform* qcms_transform_create(
if (out_type != QCMS_DATA_RGB_8 &&
out_type != QCMS_DATA_RGBA_8) {
assert(0 && "output type");
transform_free(transform);
qcms_transform_release(transform);
return NULL;
}
@ -1243,7 +1243,7 @@ qcms_transform* qcms_transform_create(
qcms_transform *result = qcms_transform_precacheLUT_float(transform, in, out, 33, in_type);
if (!result) {
assert(0 && "precacheLUT failed");
transform_free(transform);
qcms_transform_release(transform);
return NULL;
}
return result;
@ -1273,7 +1273,7 @@ qcms_transform* qcms_transform_create(
if (in_type != QCMS_DATA_RGB_8 &&
in_type != QCMS_DATA_RGBA_8){
assert(0 && "input type");
transform_free(transform);
qcms_transform_release(transform);
return NULL;
}
if (precache) {
@ -1363,7 +1363,7 @@ qcms_transform* qcms_transform_create(
if (in_type != QCMS_DATA_GRAY_8 &&
in_type != QCMS_DATA_GRAYA_8){
assert(0 && "input type");
transform_free(transform);
qcms_transform_release(transform);
return NULL;
}
@ -1388,7 +1388,7 @@ qcms_transform* qcms_transform_create(
}
} else {
assert(0 && "unexpected colorspace");
transform_free(transform);
qcms_transform_release(transform);
return NULL;
}
return transform;