Commit 7fc2b365 authored by Sebastian Ramacher's avatar Sebastian Ramacher

g_try_realloc behaves like realloc

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent d83d7bc7
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment