Fix memory leak when config conversion fails (#3006)
This happens on an empty config file, for example.
This commit is contained in:
parent
c08ef36199
commit
962750eb64
|
@ -764,6 +764,7 @@ static char *migrate_config(char *input, off_t size) {
|
||||||
wait(&status);
|
wait(&status);
|
||||||
if (!WIFEXITED(status)) {
|
if (!WIFEXITED(status)) {
|
||||||
fprintf(stderr, "Child did not terminate normally, using old config file (will lead to broken behaviour)\n");
|
fprintf(stderr, "Child did not terminate normally, using old config file (will lead to broken behaviour)\n");
|
||||||
|
FREE(converted);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -778,6 +779,7 @@ static char *migrate_config(char *input, off_t size) {
|
||||||
fprintf(stderr, "# i3 config file (v4)\n");
|
fprintf(stderr, "# i3 config file (v4)\n");
|
||||||
/* TODO: nag the user with a message to include a hint for i3 in their config file */
|
/* TODO: nag the user with a message to include a hint for i3 in their config file */
|
||||||
}
|
}
|
||||||
|
FREE(converted);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue