Skip to content

Commit

Permalink
Fix memory leak in error path of do_ftell_wide (BZ #17370)
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddhesh Poyarekar committed Sep 16, 2014
1 parent f041616 commit 545583d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
5 changes: 4 additions & 1 deletion libio/wfileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 545583d

Please sign in to comment.