Merge pull request #533 from martinetd/wl_array_add

ENOMEM checks: consistently check wl_array_add return
This commit is contained in:
Drew DeVault 2017-12-28 07:44:21 -08:00 committed by GitHub
commit bb24895a2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 48 additions and 8 deletions

View file

@ -223,7 +223,7 @@ static bool match_obj_(struct match_state *st, size_t skips, size_t score, size_
if (score > st->score || (score == st->score && replaced < st->replaced)) {
st->score = score;
st->replaced = replaced;
memcpy(st->best, st->res, sizeof st->best[0] * st->num_res);
memcpy(st->best, st->res, sizeof(st->best[0]) * st->num_res);
if (st->score == st->num_objs && st->replaced == 0) {
st->exit_early = true;