comparison system/System.cpp @ 1424:c7e68755c7ec

Add overlooked fclose in error case
author Chris Cannam
date Mon, 09 Oct 2017 11:08:59 +0100
parents 91231350ee22
children bd1a2cacd1e7
comparison
equal deleted inserted replaced
1423:04ce84f21af3 1424:c7e68755c7ec
210 if (!meminfo) return; 210 if (!meminfo) return;
211 211
212 char buf[256]; 212 char buf[256];
213 while (!feof(meminfo)) { 213 while (!feof(meminfo)) {
214 if (!fgets(buf, 256, meminfo)) { 214 if (!fgets(buf, 256, meminfo)) {
215 fclose(meminfo);
215 return; 216 return;
216 } 217 }
217 bool isMemFree = (strncmp(buf, "MemFree:", 8) == 0); 218 bool isMemFree = (strncmp(buf, "MemFree:", 8) == 0);
218 bool isMemTotal = (!isMemFree && (strncmp(buf, "MemTotal:", 9) == 0)); 219 bool isMemTotal = (!isMemFree && (strncmp(buf, "MemTotal:", 9) == 0));
219 if (isMemFree || isMemTotal) { 220 if (isMemFree || isMemTotal) {