From 2b4e549d449540d72935805b91ead7b18fc1cf39 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Tue, 13 Feb 2018 02:01:22 +0100 Subject: [PATCH] fix usage of checksum_length --- src/core/settings.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/settings.c b/src/core/settings.c index 99e7986b..215f38bb 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -685,7 +685,8 @@ static int file_checksum(const char *fname, const guint8 *old_checksum, gsize ol } close(f); - checksum = g_new0(guint8, g_checksum_type_get_length(checksum_type)); + checksum_length = g_checksum_type_get_length(checksum_type); + checksum = g_new0(guint8, checksum_length); g_checksum_get_digest(c, checksum, &checksum_length); g_checksum_free(c);