From 66fb4bc4a8f449d8065730a02049c0283c618e02 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Fri, 23 Jul 2021 18:33:19 +0200 Subject: Fix memory leak on error path The snprintf string argument should not be duplicated. It is not needed and also not released afterwards. --- src/imlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imlib.c b/src/imlib.c index 5970bd2..ea2f49c 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -1166,7 +1166,7 @@ void feh_draw_exif(winwidget w) if (buffer[0] == '\0') { - snprintf(buffer, EXIF_MAX_DATA, "%s", estrdup("Failed to run exif command")); + snprintf(buffer, EXIF_MAX_DATA, "%s", "Failed to run exif command"); gib_imlib_get_text_size(fn, buffer, NULL, &width, &height, IMLIB_TEXT_TO_RIGHT); info_buf[no_lines] = estrdup(buffer); no_lines++; -- cgit v1.2.3