From: Bruno Haible Date: Sun, 3 Aug 2025 17:34:19 +0000 (+0200) Subject: intl: Fix a small memory leak. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6fa3d8eca2cea1adc024189f35ae76481a190f40;p=thirdparty%2Fgettext.git intl: Fix a small memory leak. Reported by Coverity. * gettext-runtime/intl/loadmsgcat.c (_nl_load_domain): Free sysdep_segment_values before 'goto invalid'. --- diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c index 56fb38c04..1e2179cc8 100644 --- a/gettext-runtime/intl/loadmsgcat.c +++ b/gettext-runtime/intl/loadmsgcat.c @@ -1,5 +1,5 @@ /* Load needed message catalogs. - Copyright (C) 1995-2024 Free Software Foundation, Inc. + Copyright (C) 1995-2025 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -1018,7 +1018,10 @@ _nl_load_domain (struct loaded_l10nfile *domain_file, /* Allocate additional memory. */ mem = (char *) malloc (memneed); if (mem == NULL) - goto invalid; + { + free (sysdep_segment_values); + goto invalid; + } domain->malloced = mem; inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem;