OSDN Git Service

Stay cheesy
authorwifiextender <router@archlinux.info>
Fri, 5 Aug 2016 21:20:27 +0000 (23:20 +0200)
committerwifiextender <router@archlinux.info>
Fri, 5 Aug 2016 21:20:27 +0000 (23:20 +0200)
src/functions.c

index c232277..de5e45e 100644 (file)
@@ -146,11 +146,13 @@ get_cores_load(char *str1, char *str2) {
   }
 
   if (NULL == fgets(buf, VLA, fp)) {
+    fclose(fp);
     exit_with_err(ERR, "reached /proc/stat EOF");
   }
 
   for (x = 0; x < MAX_CORES; x++) {
     if (NULL == fgets(buf, VLA, fp)) {
+      fclose(fp);
       exit_with_err(ERR, "reached /proc/stat EOF");
     }