summaryrefslogtreecommitdiff
path: root/src/config_file.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-08-08 13:14:35 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-08-08 13:14:35 +0200
commit84fec6f628b8c82a70c0aff5dc6a47d1cdb6fbf0 (patch)
tree0b2e78e831344336e056de728414793d77aa328e /src/config_file.c
parent82ae6fcdba2aa0fb21f49b127b5f5f7a637ffc76 (diff)
downloadlibgit2-84fec6f628b8c82a70c0aff5dc6a47d1cdb6fbf0.tar.gz
config: saner iterator errors
Really report an error in foreach if we fail to allocate the iterator, and don't fail if the config is emtpy.
Diffstat (limited to 'src/config_file.c')
-rw-r--r--src/config_file.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/config_file.c b/src/config_file.c
index 849ef0f6f..6eb51ac25 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -261,9 +261,6 @@ static int config_iterator_new(
diskfile_backend *b = (diskfile_backend *)backend;
git_config_file_iter *it = git__calloc(1, sizeof(git_config_file_iter));
- if (!b->values || git_strmap_num_entries(b->values) < 1)
- return -1;
-
GITERR_CHECK_ALLOC(it);
it->parent.backend = backend;