Ignore:
Timestamp:
Mar 10, 2016, 2:28:15 AM (8 years ago)
Author:
Peter
Message:

assert on memory failures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/BamHeader.cc

    r3477 r3478  
    233233    header_ = sam_hdr_parse(txt.size(), txt.c_str());
    234234#endif
     235    // FIXME, handle failures more gracefully than two assertions
     236    // below. If allocations fail, the header should be pristine and
     237    // an exception be thrown.
     238    assert(header_);
    235239    header_->l_text = txt.size();
    236240    header_->text = (char*)realloc(header_->text, txt.size()+1);
     241    assert(header_->text);
    237242    memcpy(header_->text, txt.c_str(), txt.size()+1);
    238243#ifndef YAT_HAVE_HTSLIB
Note: See TracChangeset for help on using the changeset viewer.