summaryrefslogtreecommitdiff
path: root/src/config_file.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-02-11 09:39:38 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2015-02-12 22:54:47 -0500
commit2884cc42de8b20a58cec8488d014a853d47c047e (patch)
tree19dbb80072107fe65c7dd1de5dd849cc6914b154 /src/config_file.c
parent4aa664ae3953d99c2ae4cd769f02818bc122eebc (diff)
downloadlibgit2-2884cc42de8b20a58cec8488d014a853d47c047e.tar.gz
overflow checking: don't make callers set oom
Have the ALLOC_OVERFLOW testing macros also simply set_oom in the case where a computation would overflow, so that callers don't need to.
Diffstat (limited to 'src/config_file.c')
-rw-r--r--src/config_file.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/config_file.c b/src/config_file.c
index 36f78563b..39e9ff841 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -905,7 +905,6 @@ static char *reader_readline(struct reader *reader, bool skip_whitespace)
if (GIT_ALLOC_OVERFLOW_ADD(line_len, 1) ||
(line = git__malloc(line_len + 1)) == NULL) {
- giterr_set_oom();
return NULL;
}
@@ -1620,7 +1619,6 @@ static char *fixup_line(const char *ptr, int quote_count)
if (GIT_ALLOC_OVERFLOW_ADD(ptr_len, 1) ||
(str = git__malloc(ptr_len + 1)) == NULL) {
- giterr_set_oom();
return NULL;
}