mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-27 11:56:00 +01:00
g_try_realloc behaves like realloc
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
d83d7bc7d9
commit
7fc2b365ba
1 changed files with 4 additions and 3 deletions
|
@ -134,10 +134,11 @@ guess_type_glib(const char* path)
|
|||
g_free((void*)content_type);
|
||||
content_type = NULL;
|
||||
|
||||
content = g_try_realloc(content, length + BUFSIZ);
|
||||
if (content == NULL) {
|
||||
continue;
|
||||
guchar* temp_content = g_try_realloc(content, length + BUFSIZ);
|
||||
if (temp_content == NULL) {
|
||||
break;
|
||||
}
|
||||
content = temp_content;
|
||||
|
||||
bytes_read = read(fd, content + length, BUFSIZ);
|
||||
if (bytes_read == -1) {
|
||||
|
|
Loading…
Reference in a new issue