diff options
| author | Federico Angelilli <code@fedang.net> | 2024-03-16 02:11:10 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-03-16 02:11:10 +0100 |
| commit | 15baf349fa6985262da39b70f2d496af104c478d (patch) | |
| tree | 9d70590e9d0676268169828d7861a75f9ac18118 /src/connect.c | |
| parent | 9dcc07bdc6360b2ebbd618bb864024f62bf98918 (diff) | |
Fix some memory leaks and add valgrind support
Diffstat (limited to 'src/connect.c')
| -rw-r--r-- | src/connect.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/connect.c b/src/connect.c index ed5a23b..054153d 100644 --- a/src/connect.c +++ b/src/connect.c @@ -310,12 +310,13 @@ Connection *connect_create() g_assert_null(error); log_debug("RandR loaded [version=%d.%d]", randr_version->major_version, randr_version->minor_version); g_assert_cmpint(randr_version->major_version, >=, 1); + g_free(randr_version); xcb_randr_get_screen_info_cookie_t cookie = xcb_randr_get_screen_info(con->connection, con->screen->root); - xcb_randr_get_screen_info_reply_t *info_reply = xcb_randr_get_screen_info_reply(con->connection, cookie, &error); + con->info_reply = xcb_randr_get_screen_info_reply(con->connection, cookie, &error); g_assert_null(error); - con->screen_size = xcb_randr_get_screen_info_sizes(info_reply); + con->screen_size = xcb_randr_get_screen_info_sizes(con->info_reply); g_assert_nonnull(con->screen_size); log_debug("Screen size [width=%d, height=%d]", con->screen_size->width, con->screen_size->height); @@ -381,6 +382,8 @@ void connect_destroy(Connection *con) xcb_errors_context_free(con->errors); xcb_xrm_database_free(con->database); xcb_disconnect(con->connection); + + g_free(con->info_reply); g_free(con); } |
