buffer: rely on GITERR_OOM set by git_buf_try_grow

The function `git_buf_try_grow` consistently calls `giterr_set_oom`
whenever growing the buffer fails due to insufficient memory being
available. So in fact, we do not have to do this ourselves when a call
to any buffer-growing function has failed due to an OOM situation. But
we still do so in two functions, which this patch cleans up.
This commit is contained in:
Patrick Steinhardt 2017-06-07 10:05:54 +02:00
parent dd0aa811dd
commit 97eb5ef026
2 changed files with 0 additions and 2 deletions

View File

@ -324,7 +324,6 @@ static int pack_index_open(struct git_pack_file *p)
git_buf_put(&idx_name, p->pack_name, name_len - strlen(".pack"));
git_buf_puts(&idx_name, ".idx");
if (git_buf_oom(&idx_name)) {
giterr_set_oom();
return -1;
}

View File

@ -429,7 +429,6 @@ static int winhttp_stream_connect(winhttp_stream *s)
git_buf_printf(&processed_url, ":%s", t->proxy_connection_data.port);
if (git_buf_oom(&processed_url)) {
giterr_set_oom();
error = -1;
goto on_error;
}