Ver código fonte

pipelimit: close file stream in case of error in get cpu

Daniel-Constantin Mierla 8 anos atrás
pai
commit
5591d9c908
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1 0
      src/modules/pipelimit/pipelimit.c

+ 1 - 0
src/modules/pipelimit/pipelimit.c

@@ -222,6 +222,7 @@ static int get_cpuload(double * load)
 	if (fscanf(f, "cpu  %lld%lld%lld%lld%lld%lld%lld%lld",
 			&n_user, &n_nice, &n_sys, &n_idle, &n_iow, &n_irq, &n_sirq, &n_stl) < 0) {
 		  LM_ERR("could not parse load information\n");
+		  fclose(f);
 		  return -1;
 	}
 	fclose(f);