i3-input: Fix memory leaks

Mentioned in #4107
This commit is contained in:
Orestis Floros 2020-05-28 10:23:40 +02:00 committed by GitHub
parent dd13398e04
commit 128f9c0109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,9 +367,8 @@ free_resources:
}
int main(int argc, char *argv[]) {
format = sstrdup("%s");
char *socket_path = NULL;
char *pattern = sstrdup("pango:monospace 8");
char *pattern = NULL;
int o, option_index = 0;
static struct option long_options[] = {
@ -424,6 +423,9 @@ int main(int argc, char *argv[]) {
return 0;
}
}
if (!format) {
format = "%s";
}
printf("using format \"%s\"\n", format);
@ -440,7 +442,7 @@ int main(int argc, char *argv[]) {
symbols = xcb_key_symbols_alloc(conn);
init_dpi();
font = load_font(pattern, true);
font = load_font(pattern ? pattern : "pango:monospace 8", true);
set_font(&font);
if (prompt != NULL)