From ff976d485443d56746277f6a974dd1ae747576a9 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 20 Nov 2015 14:57:47 +0100 Subject: [PATCH] Error handling --- zathura/database-plain.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zathura/database-plain.c b/zathura/database-plain.c index e64feda..22e4636 100644 --- a/zathura/database-plain.c +++ b/zathura/database-plain.c @@ -672,7 +672,12 @@ zathura_db_read_key_file_from_file(const char* path) free(content); content = malloc(sizeof(char) * (dummy_len + 1)); - content = memcpy(content, dummy_content, dummy_len + 1); + if (content == NULL) + { + g_key_file_free(key_file); + return NULL; + } + g_strlcat(content, dummy_content, dummy_len + 1); contentlen = dummy_len; }