runtime-info: fix - close the file pointer 45/69345/2 accepted/tizen/common/20160513.123451 accepted/tizen/ivi/20160513.082115 accepted/tizen/mobile/20160513.082055 accepted/tizen/tv/20160513.082108 accepted/tizen/wearable/20160513.082103 submit/tizen/20160513.014537
authorsunm.lee <sunm.lee@samsung.com>
Fri, 13 May 2016 00:25:05 +0000 (09:25 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Fri, 13 May 2016 00:30:23 +0000 (17:30 -0700)
Close file pointer cpuinfo_fp at runtime_info_get_frequency_cpuinfo()
when function returns.

Change-Id: Id66f3507d2b40a89e00e216dd951749b36dcd803
Signed-off-by: sunm.lee <sunm.lee@samsung.com>
src/runtime_info_system.c

index fe8b10e..2761305 100644 (file)
@@ -354,10 +354,12 @@ int runtime_info_get_frequency_cpuinfo(int core_idx, int *cpu_freq)
                        }
 
                        *cpu_freq = acc_freq;
+                       fclose(cpuinfo_fp);
                        return RUNTIME_INFO_ERROR_NONE;
                }
                ++cur_core;
        }
 
+       fclose(cpuinfo_fp);
        return RUNTIME_INFO_ERROR_NOT_SUPPORTED;
 }