Free the buffer in the case where we don't create a module out of it, as

pointed out by Torok Edwin.

Remove trailing whitespaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64002 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky 2009-02-07 03:15:01 +00:00
parent 92570c4a1a
commit 0df91b2c86

View File

@ -180,10 +180,13 @@ ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
file->name,
file->offset,
strerror(errno));
free(buf);
return LDPS_ERR;
}
if (!lto_module_is_object_file_in_memory(buf, file->filesize))
if (!lto_module_is_object_file_in_memory(buf, file->filesize)) {
free(buf);
return LDPS_OK;
}
} else if (!lto_module_is_object_file(file->name))
return LDPS_OK;