~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff-delta.c

  • Committer: Martin Packman
  • Author(s): John Arbash Meinel
  • Date: 2011-09-30 16:29:17 UTC
  • mto: (6015.33.7 2.4)
  • mto: This revision was merged to the branch mainline in revision 6192.
  • Revision ID: martin.packman@canonical.com-20110930162917-zilsfmiuxzsky4so
Return early to avoid malloc(0) in create_delta_index_from_delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
720
720
 
721
721
    max_num_entries = (src->size - 1)  / RABIN_WINDOW;
722
722
 
 
723
    if (!max_num_entries) {
 
724
        *fresh = old_index;
 
725
        return DELTA_OK;
 
726
    }
 
727
 
723
728
    /* allocate an array to hold whatever entries we find */
724
729
    entries = malloc(sizeof(*entry) * max_num_entries);
725
730
    if (!entries) /* malloc failure */