summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/crash-stack/crash-stack.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/crash-stack/crash-stack.c b/src/crash-stack/crash-stack.c
index 71d2f15..82be10d 100644
--- a/src/crash-stack/crash-stack.c
+++ b/src/crash-stack/crash-stack.c
@@ -298,8 +298,10 @@ static int __attachable(pid_t pid, pid_t tid)
return -1;
/* check if status is D */
- if (fscanf(f, "%*d %*s %c", &status) != 1)
+ if (fscanf(f, "%*d %*s %c", &status) != 1) {
+ fclose(f);
return -1;
+ }
fclose(f);