summaryrefslogtreecommitdiff
path: root/runner
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2018-10-02 10:45:41 +0300
committerPetri Latvala <petri.latvala@intel.com>2018-10-03 13:28:47 +0300
commitb82c9c97efa66668de172ad04deb83c9675f6a97 (patch)
tree78d18105a4d3ba54b7942835d1ee96654b2e7ac4 /runner
parent5caab92d0b9c8516b7ea02809608fcd835af19d4 (diff)
runner: Plug more fd leaks
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'runner')
-rw-r--r--runner/resultgen.c4
-rw-r--r--runner/runner_tests.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/runner/resultgen.c b/runner/resultgen.c
index 11eff9d3..9fc54cdc 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -809,6 +809,7 @@ static void fill_from_journal(int fd,
}
free(line);
+ fclose(f);
}
static void override_result_single(struct json_object *obj)
@@ -1073,13 +1074,16 @@ bool generate_results(int dirfd)
}
if (!parse_test_directory(testdirfd, &job_list.entries[i], &settings, &results)) {
+ close(testdirfd);
close(resultsfd);
return false;
}
+ close(testdirfd);
}
json_string = json_object_to_json_string_ext(obj, JSON_C_TO_STRING_PRETTY);
write(resultsfd, json_string, strlen(json_string));
+ close(resultsfd);
return true;
}
diff --git a/runner/runner_tests.c b/runner/runner_tests.c
index b03f2acf..3705d711 100644
--- a/runner/runner_tests.c
+++ b/runner/runner_tests.c
@@ -50,6 +50,8 @@ static char *dump_file(int dirfd, char *name)
}
s = read(fd, buf, 255);
+ close(fd);
+
if (s < 0) {
free(buf);
return NULL;