mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-02 17:42:31 +00:00
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:
parent
dd0aa811dd
commit
97eb5ef026
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user