mirror of
https://github.com/flatpak/flatpak.git
synced 2026-10-07 21:41:51 -04:00
_GLNX_TEST_SCOPED_TEMP_DIR: Fix memory and fd leak
This doesn't really matter, since it only happens when our process is about to exit anyway, but it makes it easier to use AddressSanitizer and similar tools. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
1 parent
5f3d352aa4
commit
a652ede20b
1 file changed
+8
@@ -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);
|
||||
}
|
||||
Reference in new issue
Block a user