From 0b94ce21672b96556843efee70318932c321a97f Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 11 Jan 2025 18:59:59 +0000 Subject: [PATCH] keys: Map them into memory Signed-off-by: Michael Tremer --- src/pakfire/key.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pakfire/key.c b/src/pakfire/key.c index 003fca56c..d6adb5f83 100644 --- a/src/pakfire/key.c +++ b/src/pakfire/key.c @@ -923,8 +923,8 @@ int pakfire_key_signf(struct pakfire_key* key, FILE* s, FILE* f, const char* com size_t length = 0; int r; - // Load the entire content into memory - r = pakfire_read_file_into_buffer(f, &buffer, &length); + // Map the entire content into memory + r = pakfire_mmap(fileno(f), &buffer, &length); if (r < 0) goto ERROR; @@ -933,7 +933,7 @@ int pakfire_key_signf(struct pakfire_key* key, FILE* s, FILE* f, const char* com ERROR: if (buffer) - free(buffer); + munmap(buffer, length); return r; } -- 2.47.3