[llvm-commits] [llvm] r63907 - /llvm/trunk/tools/gold/gold-plugin.cpp

Török Edwin edwintorok at gmail.com
Fri Feb 6 00:09:08 PST 2009


On 2009-02-06 03:58, Nick Lewycky wrote:
> Author: nicholas
> Date: Thu Feb  5 19:58:34 2009
> New Revision: 63907
>
> URL: http://llvm.org/viewvc/llvm-project?rev=63907&view=rev
> Log:
> Free the buffer.
>
> Modified:
>     llvm/trunk/tools/gold/gold-plugin.cpp
>
> Modified: llvm/trunk/tools/gold/gold-plugin.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=63907&r1=63906&r2=63907&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/gold/gold-plugin.cpp (original)
> +++ llvm/trunk/tools/gold/gold-plugin.cpp Thu Feb  5 19:58:34 2009
> @@ -180,13 +180,10 @@
>                   file->name,
>                   file->offset,           
>                   strerror(errno));
> -      free(buf);
>        return LDPS_ERR;
>      }
> -    if (!lto_module_is_object_file_in_memory(buf, file->filesize)) {
> -      free(buf);
> +    if (!lto_module_is_object_file_in_memory(buf, file->filesize))
>        return LDPS_OK;
>   

Why not free the buffer here? Gold will process the file on LDPS_OK, right?

Best regards,
--Edwin



More information about the llvm-commits mailing list