On 27.05.11 17:32:55, William Cohen wrote:
> The close(fd) was after the throw. A Coverity scan pointed out that the
> close(fd) would be unreachable. Reorder the statements to make sure that
> close(fd) occurs before the throw.
>
> Signed-off-by: William Cohen <wcohen@...>
> ---
> libpp/op_header.cpp | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/libpp/op_header.cpp b/libpp/op_header.cpp
> index 041a1e8..754015a 100644
> --- a/libpp/op_header.cpp
> +++ b/libpp/op_header.cpp
> @@ -142,10 +142,10 @@ opd_header const read_header(string const & sample_filename)
> }
>
> if (memcmp(header.magic, OPD_MAGIC, sizeof(header.magic))) {
> + close(fd);
Can't we put this before the memcmp()?
> throw op_fatal_error("Invalid sample file, "
> "bad magic number: " +
> sample_filename);
> - close(fd);
> }
>
> close(fd);
This would be obsolete then.
-Robert
> --
> 1.7.1
>
>
> ------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> _______________________________________________
> oprofile-list mailing list
> oprofile-list@...
> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>
--
Advanced Micro Devices, Inc.
Operating System Research Center
|