mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-10 18:03:47 +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
@ -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 New Issue
Block a user