From: Bruno Haible Date: Tue, 2 May 2006 12:27:58 +0000 (+0000) Subject: Don't leak FILE objects. X-Git-Tag: v0.15~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e11d1a486d5ce297938dab8f26b89437f2284743;p=thirdparty%2Fgettext.git Don't leak FILE objects. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index bfc82934a..ba4d412ea 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,8 @@ +2006-04-30 Bruno Haible + + * msginit.c (project_id, project_id_version, get_user_email): Close + the FILE in case of I/O error. + 2006-04-30 Bruno Haible * write-java.c (msgdomain_write_java): Don't fclose the FILE after diff --git a/gettext-tools/src/msginit.c b/gettext-tools/src/msginit.c index fac4d550f..73d49d582 100644 --- a/gettext-tools/src/msginit.c +++ b/gettext-tools/src/msginit.c @@ -800,6 +800,7 @@ project_id () if (linelen == (size_t)(-1)) { error (0, 0, _("%s subprocess I/O error"), prog); + fclose (fp); goto failed; } if (linelen > 0 && line[linelen - 1] == '\n') @@ -867,6 +868,7 @@ project_id_version () if (linelen == (size_t)(-1)) { error (0, 0, _("%s subprocess I/O error"), prog); + fclose (fp); goto failed; } if (linelen > 0 && line[linelen - 1] == '\n') @@ -1025,6 +1027,7 @@ you in case of unexpected technical problems.\n"); if (linelen == (size_t)(-1)) { error (0, 0, _("%s subprocess I/O error"), prog); + fclose (fp); goto failed; } if (linelen > 0 && line[linelen - 1] == '\n')