From: Bruno Haible Date: Thu, 18 May 2017 23:37:15 +0000 (+0200) Subject: Fix missing unlock. X-Git-Tag: v0.20~461 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc0ffc8b991de10acc7cf6c982f695c91b36e928;p=thirdparty%2Fgettext.git Fix missing unlock. Found by Coverity. * gettext-runtime/intl/dcigettext.c (_nl_find_msg): Unlock the lock and free allocated memory before returning. --- diff --git a/gettext-runtime/intl/dcigettext.c b/gettext-runtime/intl/dcigettext.c index 92f6fd685..e81fdafd2 100644 --- a/gettext-runtime/intl/dcigettext.c +++ b/gettext-runtime/intl/dcigettext.c @@ -1,5 +1,5 @@ /* Implementation of the internal dcigettext function. - Copyright (C) 1995-2016 Free Software Foundation, Inc. + Copyright (C) 1995-2017 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 @@ -1111,7 +1111,12 @@ _nl_find_msg (struct loaded_l10nfile *domain_file, /* Resource problems are fatal. If we continue onwards we will only attempt to calloc a new conv_tab and fail later. */ if (__builtin_expect (nullentry == (char *) -1, 0)) - return (char *) -1; + { +# ifndef IN_LIBGLOCALE + free ((char *) encoding); +# endif + goto unlock_fail; + } if (nullentry != NULL) {