commit - 34570dbeba22613374809c75a8ed2f119db01ec5
commit + f087e96869b35f67db93f1a9a3df95d0dc9da883
blob - ad806a685d86d1d9066a335ca6fa232798e391de
blob + ccc539a9a6b47881667a6b8d2c1c7b0fd71fe10c
--- lib/diff_patience.c
+++ lib/diff_patience.c
{
struct diff_atom *a;
struct diff_atom *b;
- struct diff_atom **all_atoms =
- malloc((left->atoms.len + right->atoms.len)
- * sizeof(struct diff_atom*));
+ struct diff_atom **all_atoms;
unsigned int len = 0;
unsigned int i;
unsigned int unique_in_both_count = 0;
int rc;
+
+ all_atoms = calloc(left->atoms.len + right->atoms.len,
+ sizeof(struct diff_atom *));
+ if (all_atoms == NULL)
+ return ENOMEM;
+
left->err = 0;
right->err = 0;
left->root->err = 0;