]> sourceware.org Git - glibc.git/commitdiff
Fix memory leak in error path of do_ftell_wide (BZ #17370)
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Tue, 16 Sep 2014 08:50:45 +0000 (14:20 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Tue, 16 Sep 2014 08:50:45 +0000 (14:20 +0530)
ChangeLog
libio/wfileops.c

index 915b492006cee6e4dcc435d39613937fb2cb83a4..d5fd959e0d1252f0758f9c5276748269373c169a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-16  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+       [BZ #17370]
+       * libio/wfileops.c (do_ftell_wide): Free OUT on error path.
+
 2014-09-16  Siddhesh Poyarekar  <siddhesh@redhat.com>
            Jakub Jelinek  <jakub@redhat.com>
 
index ebc06e85de33a594c9c426526f7a04730d358e0b..c5ec5f7a278dd08064cbc4162ab758217281f0b7 100644 (file)
@@ -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);
This page took 0.111057 seconds and 5 git commands to generate.