Close file after reading 21/63621/1 accepted/tizen/common/20160325.135635 accepted/tizen/ivi/20160325.071930 accepted/tizen/mobile/20160325.071747 accepted/tizen/tv/20160325.071818 accepted/tizen/wearable/20160325.071855 submit/tizen/20160325.030803
authorKichan Kwon <k_c.kwon@samsung.com>
Fri, 25 Mar 2016 02:59:29 +0000 (11:59 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Fri, 25 Mar 2016 02:59:29 +0000 (11:59 +0900)
Change-Id: I23114971925f436109986d163e62d941c57c6470
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
src/runtime_info_usage.c

index fec3cc2..441a3b4 100644 (file)
@@ -410,11 +410,13 @@ API int runtime_info_get_processor_count(int *num_core)
        if(!fscanf(cpuinfo_fp, "%d-%d", &buf, &result)) {
                _E("IO_ERROR(0x%08x) : there is no information in the system file",
                                RUNTIME_INFO_ERROR_IO_ERROR);
+               fclose(cpuinfo_fp);
                return RUNTIME_INFO_ERROR_IO_ERROR;
        }
 
        *num_core = result + 1;
 
+       fclose(cpuinfo_fp);
        return RUNTIME_INFO_ERROR_NONE;
 }
 
@@ -460,11 +462,13 @@ API int runtime_info_get_processor_current_frequency(int core_idx, int *cpu_freq
        if(!fscanf(cpuinfo_fp, "%d", &result)) {
                _E("IO_ERROR(0x%08x) : there is no information in the system file",
                                RUNTIME_INFO_ERROR_IO_ERROR);
+               fclose(cpuinfo_fp);
                return RUNTIME_INFO_ERROR_IO_ERROR;
        }
 
        *cpu_freq = result / 1000;
 
+       fclose(cpuinfo_fp);
        return RUNTIME_INFO_ERROR_NONE;
 }
 
@@ -510,10 +514,12 @@ API int runtime_info_get_processor_max_frequency(int core_idx, int *cpu_freq)
        if(!fscanf(cpuinfo_fp, "%d", &result)) {
                _E("IO_ERROR(0x%08x) : there is no information in the system file",
                                RUNTIME_INFO_ERROR_IO_ERROR);
+               fclose(cpuinfo_fp);
                return RUNTIME_INFO_ERROR_IO_ERROR;
        }
 
        *cpu_freq = result / 1000;
 
+       fclose(cpuinfo_fp);
        return RUNTIME_INFO_ERROR_NONE;
 }