This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug stdio/24583] New: Memory leak in fopen with ccs argument
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 20 May 2019 10:19:07 +0000
- Subject: [Bug stdio/24583] New: Memory leak in fopen with ccs argument
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=24583
Bug ID: 24583
Summary: Memory leak in fopen with ccs argument
Product: glibc
Version: 2.30
Status: NEW
Severity: minor
Priority: P2
Component: stdio
Assignee: unassigned at sourceware dot org
Reporter: fweimer at redhat dot com
Target Milestone: ---
Flags: security-
Reproducer:
#include <err.h>
#include <locale.h>
#include <stdio.h>
int
main (void)
{
if (setlocale (LC_ALL, "fr_FR.iso885915@euro") == NULL)
err (1, "setlocale");
FILE *fp = fopen ("/etc/passwd", "r,ccs=UTF-8");
if (fp == NULL)
err (1, "fopen");
if (fclose (fp) != 0)
err (1, "fclose");
return 0;
}
The problem seems to be that the libio code never calls __gconv_close_transform
for the gconv functions returned by __wcsmbs_named_conv. Calling
__gconv_release_step in _IO_new_fclose is not sufficient.
--
You are receiving this mail because:
You are on the CC list for the bug.