From 9b4efdc1943c3ad3493c77c07eb32f15390c04a5 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 9 Jan 2016 17:07:23 +0100 Subject: [PATCH] font: free errors --- libi3/font.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libi3/font.c b/libi3/font.c index 9e72849a..5a2504fa 100644 --- a/libi3/font.c +++ b/libi3/font.c @@ -224,6 +224,7 @@ i3Font load_font(const char *pattern, const bool fallback) { info_cookie = xcb_query_font(conn, font.specific.xcb.id); /* Check if we managed to open 'fixed' */ + free(error); error = xcb_request_check(conn, font_cookie); /* Fall back to '-misc-*' if opening 'fixed' fails. */ @@ -234,12 +235,16 @@ i3Font load_font(const char *pattern, const bool fallback) { strlen(pattern), pattern); info_cookie = xcb_query_font(conn, font.specific.xcb.id); + free(error); if ((error = xcb_request_check(conn, font_cookie)) != NULL) errx(EXIT_FAILURE, "Could open neither requested font nor fallbacks " "(fixed or -misc-*): X11 error %d", error->error_code); } } + if (error != NULL) { + free(error); + } font.pattern = sstrdup(pattern); LOG("Using X font %s\n", pattern); -- 2.39.5