+2010-02-26 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (process_file): Don't leak an fd in failure case.
+
2010-02-15 Roland McGrath <roland@redhat.com>
* Makefile.am: Use config/eu.am for common stuff.
if (dwfl_report_offline (dwfl, fname, fname, dwfl_fd) == NULL)
{
struct stat64 st;
- if (fstat64 (fd, &st) != 0)
+ if (fstat64 (dwfl_fd, &st) != 0)
error (0, errno, gettext ("cannot stat input file"));
else if (unlikely (st.st_size == 0))
error (0, 0, gettext ("input file is empty"));
else
error (0, 0, gettext ("failed reading '%s': %s"),
fname, dwfl_errmsg (-1));
+ close (dwfl_fd); /* Consumed on success, not on failure. */
}
else
{