skel_fd is passed to create_dwfl, which calls dup() on skel_fd.
create_dwfl handles closing the duped fd but not the original.
Ensure the original skel_fd is closed after it's passed to create_dwfl.
Signed-off-by: Aaron Merey <amerey@redhat.com>
fprintf (stderr, "Warning: Couldn't open DWARF skeleton file"
" '%s'\n", skel_name);
else
- skel_dwfl = create_dwfl (skel_fd, skel_name);
+ {
+ skel_dwfl = create_dwfl (skel_fd, skel_name);
+
+ /* skel_fd was dup'ed by create_dwfl. We can close the
+ original now. */
+ close (skel_fd);
+ }
if (skel_dwfl != NULL)
{