diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2020-03-15 18:23:36 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2020-03-15 18:23:36 +0000 |
commit | bf851fbe08b1baa51316431ef3777515ceffa6be (patch) | |
tree | 6b2113b3716e2b7596943740ade3d10ed8d84cd3 | |
parent | c316e517ab3f013e54f3d48463d7a84a9ad1b306 (diff) | |
parent | a652ede20b6bc4726fbbce41ea4657fc83d8c6bb (diff) | |
download | libglnx-bf851fbe08b1baa51316431ef3777515ceffa6be.tar.gz |
Merge branch 'auto-temp-dir-leak' into 'master'
_GLNX_TEST_SCOPED_TEMP_DIR: Fix memory and fd leak
See merge request GNOME/libglnx!14
-rw-r--r-- | tests/libglnx-testlib.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/libglnx-testlib.c b/tests/libglnx-testlib.c index 5687d80..869d144 100644 --- a/tests/libglnx-testlib.c +++ b/tests/libglnx-testlib.c @@ -23,6 +23,8 @@ #include <errno.h> +#include <glib/gstdio.h> + #include "libglnx.h" struct _GLnxTestAutoTempDir @@ -63,4 +65,10 @@ _glnx_test_auto_temp_dir_leave (_GLnxTestAutoTempDir *dir) glnx_tmpdir_delete (&dir->temp_dir, NULL, &error); g_assert_no_error (error); + + g_close (dir->old_cwd_fd, &error); + g_assert_no_error (error); + + g_free (dir->old_cwd); + g_free (dir); } |