igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] runner: Plug more fd leaks
@ 2018-10-02  7:45 Petri Latvala
  2018-10-02  7:45 ` [igt-dev] [PATCH i-g-t 2/2] runner: Add a unit test that checks for " Petri Latvala
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Petri Latvala @ 2018-10-02  7:45 UTC (permalink / raw)
  To: igt-dev

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 runner/resultgen.c    | 4 ++++
 runner/runner_tests.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/runner/resultgen.c b/runner/resultgen.c
index e8a60083..4e6528b8 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)
@@ -1058,13 +1059,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;
-- 
2.18.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-03  9:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-02  7:45 [igt-dev] [PATCH i-g-t 1/2] runner: Plug more fd leaks Petri Latvala
2018-10-02  7:45 ` [igt-dev] [PATCH i-g-t 2/2] runner: Add a unit test that checks for " Petri Latvala
2018-10-02  8:40 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] runner: Plug more " Patchwork
2018-10-02  9:52 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-10-03  9:54 ` [igt-dev] [PATCH i-g-t 1/2] " Arkadiusz Hiler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).