/[packages]/cauldron/glibc/current/SOURCES/glibc-2.20-Fix-memory-leak-in-error-path-of-do_ftell_wide-BZ17370.patch
ViewVC logotype

Contents of /cauldron/glibc/current/SOURCES/glibc-2.20-Fix-memory-leak-in-error-path-of-do_ftell_wide-BZ17370.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 724574 - (show annotations) (download)
Thu Sep 25 08:46:52 2014 UTC (9 years, 6 months ago) by tmb
File size: 1209 byte(s)
- Fix memory leak in libio/wfileops.c do_ftell_wide [BZ #17370]
- Fix memory leak in error path of do_ftell_wide [BZ #17370]


1 From 4adf2992ac7ebf6720d8d56589eb297f5215730c Mon Sep 17 00:00:00 2001
2 From: Siddhesh Poyarekar <siddhesh@redhat.com>
3 Date: Tue, 16 Sep 2014 14:20:45 +0530
4 Subject: [PATCH] Fix memory leak in error path of do_ftell_wide (BZ #17370)
5
6 (cherry picked from commit 545583d664b64ff234b99aca0d85e99c8a55808f)
7 ---
8 ChangeLog | 5 +++++
9 libio/wfileops.c | 5 ++++-
10 2 files changed, 9 insertions(+), 1 deletions(-)
11
12 #diff --git a/ChangeLog b/ChangeLog
13 #index 9ebf81e..890c3c6 100644
14 #--- a/ChangeLog
15 #+++ b/ChangeLog
16 #@@ -1,3 +1,8 @@
17 #+2014-09-16 Siddhesh Poyarekar <siddhesh@redhat.com>
18 #+
19 #+ [BZ #17370]
20 #+ * libio/wfileops.c (do_ftell_wide): Free OUT on error path.
21 #+
22 # 2014-09-11 Tim Lammens <tim.lammens@gmail.com>
23 #
24 # [BZ #17370]
25 diff --git a/libio/wfileops.c b/libio/wfileops.c
26 index ebc06e8..c5ec5f7 100644
27 --- a/libio/wfileops.c
28 +++ b/libio/wfileops.c
29 @@ -708,7 +708,10 @@ do_ftell_wide (_IO_FILE *fp)
30 sequences must be complete since they are accepted as
31 wchar_t; if not, then that is an error. */
32 if (__glibc_unlikely (status != __codecvt_ok))
33 - return WEOF;
34 + {
35 + free (out);
36 + return WEOF;
37 + }
38
39 offset += outstop - out;
40 free (out);
41 --
42 1.7.1
43

  ViewVC Help
Powered by ViewVC 1.1.30