From 641fa990f97ba190c579ef17cec075e327e5ee46 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 24 Mar 2023 12:13:52 +0100 Subject: [PATCH] [cache,persistent] use aligned allocation --- libfreerdp/cache/persistent.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libfreerdp/cache/persistent.c b/libfreerdp/cache/persistent.c index e1c74c378..1230ab729 100644 --- a/libfreerdp/cache/persistent.c +++ b/libfreerdp/cache/persistent.c @@ -154,15 +154,11 @@ static int persistent_cache_read_entry_v3(rdpPersistentCache* persistent, if (entry->size > persistent->bmpSize) { persistent->bmpSize = entry->size; - BYTE* bmpData = (BYTE*)realloc(persistent->bmpData, persistent->bmpSize); + BYTE* bmpData = (BYTE*)winpr_aligned_recalloc(persistent->bmpData, persistent->bmpSize, + sizeof(BYTE), 32); if (!bmpData) - { - free(persistent->bmpData); - persistent->bmpData = NULL; - persistent->bmpSize = 0; return -1; - } persistent->bmpData = bmpData; } @@ -369,7 +365,7 @@ void persistent_cache_free(rdpPersistentCache* persistent) free(persistent->filename); - free(persistent->bmpData); + winpr_aligned_free(persistent->bmpData); free(persistent); }