font: free errors
This commit is contained in:
parent
17c55792c6
commit
9b4efdc194
|
@ -224,6 +224,7 @@ i3Font load_font(const char *pattern, const bool fallback) {
|
||||||
info_cookie = xcb_query_font(conn, font.specific.xcb.id);
|
info_cookie = xcb_query_font(conn, font.specific.xcb.id);
|
||||||
|
|
||||||
/* Check if we managed to open 'fixed' */
|
/* Check if we managed to open 'fixed' */
|
||||||
|
free(error);
|
||||||
error = xcb_request_check(conn, font_cookie);
|
error = xcb_request_check(conn, font_cookie);
|
||||||
|
|
||||||
/* Fall back to '-misc-*' if opening 'fixed' fails. */
|
/* Fall back to '-misc-*' if opening 'fixed' fails. */
|
||||||
|
@ -234,12 +235,16 @@ i3Font load_font(const char *pattern, const bool fallback) {
|
||||||
strlen(pattern), pattern);
|
strlen(pattern), pattern);
|
||||||
info_cookie = xcb_query_font(conn, font.specific.xcb.id);
|
info_cookie = xcb_query_font(conn, font.specific.xcb.id);
|
||||||
|
|
||||||
|
free(error);
|
||||||
if ((error = xcb_request_check(conn, font_cookie)) != NULL)
|
if ((error = xcb_request_check(conn, font_cookie)) != NULL)
|
||||||
errx(EXIT_FAILURE, "Could open neither requested font nor fallbacks "
|
errx(EXIT_FAILURE, "Could open neither requested font nor fallbacks "
|
||||||
"(fixed or -misc-*): X11 error %d",
|
"(fixed or -misc-*): X11 error %d",
|
||||||
error->error_code);
|
error->error_code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (error != NULL) {
|
||||||
|
free(error);
|
||||||
|
}
|
||||||
|
|
||||||
font.pattern = sstrdup(pattern);
|
font.pattern = sstrdup(pattern);
|
||||||
LOG("Using X font %s\n", pattern);
|
LOG("Using X font %s\n", pattern);
|
||||||
|
|
Loading…
Reference in New Issue