summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2021-06-02 15:17:52 +0200
committerUli Schlachter <psychon@znc.in>2021-09-15 18:14:37 +0200
commitd2f5e7e46e430e7f9f9ca5244752e888c7c450e3 (patch)
treedf771bfa2911e6da75616a5ef465cae29e0c4aaf
parent2e500f08177e64c52915d988e862ae630826045f (diff)
downloadi3-d2f5e7e46e430e7f9f9ca5244752e888c7c450e3.tar.gz
i3-d2f5e7e46e430e7f9f9ca5244752e888c7c450e3.zip
Fix a minor memory leak
When xcb_request_check() returns an error, something has to clean up and free this error. Signed-off-by: Uli Schlachter <psychon@znc.in>
-rw-r--r--libi3/draw_util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libi3/draw_util.c b/libi3/draw_util.c
index e698135d..30eae656 100644
--- a/libi3/draw_util.c
+++ b/libi3/draw_util.c
@@ -47,6 +47,7 @@ void draw_util_surface_init(xcb_connection_t *conn, surface_t *surface, xcb_draw
xcb_generic_error_t *error = xcb_request_check(conn, gc_cookie);
if (error != NULL) {
ELOG("Could not create graphical context. Error code: %d. Please report this bug.\n", error->error_code);
+ free(error);
}
surface->surface = cairo_xcb_surface_create(conn, surface->id, visual, width, height);