From 72170720fbe0530e6770b864cf1cc558fb62ace3 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 27 May 2020 20:24:02 +0200 Subject: [PATCH] fix memleak on realloc --- client/src/ui.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/ui.c b/client/src/ui.c index cc256d8e3..5764e63df 100644 --- a/client/src/ui.c +++ b/client/src/ui.c @@ -100,8 +100,10 @@ int searchHomeFilePath(char **foundpath, const char *subdir, const char *filenam if (subdir != NULL) { pathlen += strlen(subdir); path = realloc(path, pathlen * sizeof(char)); - if (path == NULL) + if (path == NULL) { + free(path); return PM3_EMALLOC; + } strcat(path, subdir); #ifdef _WIN32 @@ -536,7 +538,6 @@ void memcpy_filter_emoji(void *dest, const void *src, size_t n, emojiMode_t mode } } memcpy(rdest + si, current_token, current_token_length); - si += current_token_length; } }