Mercurial > vim
comparison src/quickfix.c @ 11422:ad4b56939140 v8.0.0595
patch 8.0.0595: Coverity warning for not checking return value
commit https://github.com/vim/vim/commit/beb9cb19c660484488a71a25eda46ab0fa579278
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 1 14:14:04 2017 +0200
patch 8.0.0595: Coverity warning for not checking return value
Problem: Coverity warning for not checking return value of dict_add().
Solution: Check the return value for FAIL.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 01 May 2017 14:15:03 +0200 |
parents | 84baca75b7f2 |
children | 3270f080bf0a |
comparison
equal
deleted
inserted
replaced
11421:709b5eb4cf26 | 11422:ad4b56939140 |
---|---|
4720 { | 4720 { |
4721 di = dictitem_alloc((char_u *)"context"); | 4721 di = dictitem_alloc((char_u *)"context"); |
4722 if (di != NULL) | 4722 if (di != NULL) |
4723 { | 4723 { |
4724 copy_tv(qi->qf_lists[qf_idx].qf_ctx, &di->di_tv); | 4724 copy_tv(qi->qf_lists[qf_idx].qf_ctx, &di->di_tv); |
4725 dict_add(retdict, di); | 4725 if (dict_add(retdict, di) == FAIL) |
4726 dictitem_free(di); | |
4726 } | 4727 } |
4727 } | 4728 } |
4728 else | 4729 else |
4729 status = dict_add_nr_str(retdict, "context", 0L, (char_u *)""); | 4730 status = dict_add_nr_str(retdict, "context", 0L, (char_u *)""); |
4730 } | 4731 } |