summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/utils/pldd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/winsup/utils/pldd.c b/winsup/utils/pldd.c
index f97741950..f077e63ab 100644
--- a/winsup/utils/pldd.c
+++ b/winsup/utils/pldd.c
@@ -115,12 +115,16 @@ main (int argc, char *argv[])
if (!fd)
error (1, ENOENT, "cannot open /proc/%d", pid);
fscanf (fd, "%d", &winpid);
+ fclose (fd);
exefile = (char *) malloc (32);
exename = (char *) malloc (MAX_PATH);
sprintf (exefile, "/proc/%d/exename", pid);
fd = fopen (exefile, "rb");
+ if (!fd)
+ error (1, ENOENT, "cannot open /proc/%d", pid);
fscanf (fd, "%s", exename);
+ fclose (fd);
hProcess = OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
0, winpid);