Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Fix a minor memory leak
Browse files Browse the repository at this point in the history
When xcb_request_check() returns an error, something has to clean up and
free this error.

Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information
psychon committed Sep 15, 2021
1 parent 2e500f0 commit d2f5e7e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libi3/draw_util.c
Expand Up @@ -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);
Expand Down

0 comments on commit d2f5e7e

Please sign in to comment.