Fix handle leak 38/106638/1 accepted/tizen/3.0/common/20161223.110758 accepted/tizen/3.0/ivi/20161223.082249 accepted/tizen/3.0/mobile/20161223.082230 accepted/tizen/3.0/tv/20161223.082234 accepted/tizen/3.0/wearable/20161223.082240 submit/tizen_3.0/20161222.092901 submit/tizen_3.0/20161222.232700
authorSunmin Lee <sunm.lee@samsung.com>
Thu, 22 Dec 2016 08:58:58 +0000 (17:58 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Thu, 22 Dec 2016 08:58:58 +0000 (17:58 +0900)
Fix handle leak of file pointer at crash-stack

Change-Id: I2d68e04ad84ea7263e3c45cc91ef295557532bde
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
src/crash-stack/crash-stack.c

index 71d2f15..82be10d 100644 (file)
@@ -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);