From: Siddhesh Poyarekar Date: Tue, 16 Sep 2014 08:50:45 +0000 (+0530) Subject: Fix memory leak in error path of do_ftell_wide (BZ #17370) X-Git-Tag: glibc-2.21~552 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=545583d664b64ff234b99aca0d85e99c8a55808f;p=glibc.git Fix memory leak in error path of do_ftell_wide (BZ #17370) --- diff --git a/ChangeLog b/ChangeLog index 915b492006..d5fd959e0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-09-16 Siddhesh Poyarekar + + [BZ #17370] + * libio/wfileops.c (do_ftell_wide): Free OUT on error path. + 2014-09-16 Siddhesh Poyarekar Jakub Jelinek diff --git a/libio/wfileops.c b/libio/wfileops.c index ebc06e85de..c5ec5f7a27 100644 --- a/libio/wfileops.c +++ b/libio/wfileops.c @@ -708,7 +708,10 @@ do_ftell_wide (_IO_FILE *fp) sequences must be complete since they are accepted as wchar_t; if not, then that is an error. */ if (__glibc_unlikely (status != __codecvt_ok)) - return WEOF; + { + free (out); + return WEOF; + } offset += outstop - out; free (out);