From 254636d7f4be7df048ec4c17cc9159da661a2d97 Mon Sep 17 00:00:00 2001 From: Sunmin Lee Date: Thu, 22 Dec 2016 17:58:58 +0900 Subject: Fix handle leak Fix handle leak of file pointer at crash-stack Change-Id: I2d68e04ad84ea7263e3c45cc91ef295557532bde Signed-off-by: Sunmin Lee --- src/crash-stack/crash-stack.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/crash-stack') 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); -- cgit v1.2.3