From: Michael Stapelberg Date: Sat, 9 Jan 2016 16:07:23 +0000 (+0100) Subject: font: free errors X-Git-Tag: 4.12~39 X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=commitdiff_plain;h=9b4efdc1943c3ad3493c77c07eb32f15390c04a5 font: free errors --- 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);