~mvo/apt/lp346386

« back to all changes in this revision

Viewing changes to methods/rred.cc

  • Committer: Michael Vogt
  • Date: 2012-01-30 19:22:18 UTC
  • mfrom: (1561.70.94 apt-experimental)
  • Revision ID: michael.vogt@ubuntu.com-20120130192218-hdnxpmj5yhteekf1
mergedĀ fromĀ donkult

Show diffs side-by-side

added added

removed removed

Lines of Context:
333
333
                }
334
334
                if(command_count == command_alloc) {
335
335
                        command_alloc = (command_alloc + 64) * 3 / 2;
336
 
                        commands = (EdCommand*) realloc(commands, command_alloc * sizeof(EdCommand));
 
336
                        EdCommand* newCommands = (EdCommand*) realloc(commands, command_alloc * sizeof(EdCommand));
 
337
                        if (newCommands == NULL) {
 
338
                                free(commands);
 
339
                                return MMAP_FAILED;
 
340
                        }
 
341
                        commands = newCommands;
337
342
                }
338
343
                commands[command_count++] = cmd;
339
344
        }