From d5572356b644a8aab9681ecaa6e2fa1bbc575ed2 Mon Sep 17 00:00:00 2001 From: ralfbrown Date: Fri, 3 Oct 2025 20:55:49 -0400 Subject: [PATCH] prevent crash when localizing empty string --- src/common/utility.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/common/utility.c b/src/common/utility.c index ebec5c849fc3..61d0f1257778 100644 --- a/src/common/utility.c +++ b/src/common/utility.c @@ -1,6 +1,6 @@ /* This file is part of darktable, - Copyright (C) 2010-2024 darktable developers. + Copyright (C) 2010-2025 darktable developers. darktable is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -91,11 +91,10 @@ gchar *dt_util_localize_segmented_name(const char *s, const char *l_name = dt_util_localize_string(name); items = g_list_append(items, (void *)l_name); } + g_free(localized); + localized = dt_util_glist_to_str(sep, items); } - g_free(localized); - localized = dt_util_glist_to_str(sep, items); - g_list_free(items); g_strfreev(split); }