diff options
Diffstat (limited to 'libs/elfio/elfio/elfio_segment.hpp')
-rw-r--r-- | libs/elfio/elfio/elfio_segment.hpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libs/elfio/elfio/elfio_segment.hpp b/libs/elfio/elfio/elfio_segment.hpp index 642fd29..f27b395 100644 --- a/libs/elfio/elfio/elfio_segment.hpp +++ b/libs/elfio/elfio/elfio_segment.hpp @@ -54,7 +54,7 @@ class segment protected: ELFIO_SET_ACCESS_DECL( Elf64_Off, offset ); ELFIO_SET_ACCESS_DECL( Elf_Half, index ); - + virtual const std::vector<Elf_Half>& get_sections() const = 0; virtual void load( std::istream& stream, std::streampos header_offset ) = 0; virtual void save( std::ostream& stream, std::streampos header_offset, @@ -101,7 +101,7 @@ class segment_impl : public segment } //------------------------------------------------------------------------------ - void + void set_stream_size(size_t value) { stream_size = value; @@ -177,7 +177,7 @@ class segment_impl : public segment { return sections; } - + //------------------------------------------------------------------------------ void set_index( Elf_Half value ) @@ -206,12 +206,8 @@ class segment_impl : public segment data = 0; } else { - try { - data = new char[size + 1]; - } catch (const std::bad_alloc&) { - data = 0; - } - + data = new char[size + 1]; + if ( 0 != data ) { stream.read( data, size ); data[size] = 0; |