зеркало из https://github.com/mozilla/pjs.git
Bug 497363. qcms: Fix a memory leak when fread() fails. r=joedrew
Fixes a possible leak in qcms_profile_from_file() when fread() can't read the entire profile.
This commit is contained in:
Родитель
dfc71274bc
Коммит
4b5a8fbe74
|
@ -765,8 +765,10 @@ qcms_profile* qcms_profile_from_file(FILE *file)
|
|||
|
||||
/* read the rest profile */
|
||||
read_length = fread((unsigned char*)data + sizeof(length_be), 1, remaining_length, file);
|
||||
if (read_length != remaining_length)
|
||||
if (read_length != remaining_length) {
|
||||
free(data);
|
||||
return INVALID_PROFILE;
|
||||
}
|
||||
|
||||
profile = qcms_profile_from_memory(data, length);
|
||||
free(data);
|
||||
|
|
Загрузка…
Ссылка в новой задаче