free the directory argument
This commit is contained in:
parent
f327726f88
commit
9faaf34665
|
@ -1163,7 +1163,7 @@ static void exit_with_status(VteTerminal *vte) {
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
const char *const term = "xterm-termite";
|
const char *const term = "xterm-termite";
|
||||||
const char *directory = nullptr;
|
char *directory = nullptr;
|
||||||
gboolean version = FALSE, hold = FALSE;
|
gboolean version = FALSE, hold = FALSE;
|
||||||
|
|
||||||
GOptionContext *context = g_option_context_new(NULL);
|
GOptionContext *context = g_option_context_new(NULL);
|
||||||
|
@ -1190,10 +1190,13 @@ int main(int argc, char **argv) {
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (directory && chdir(directory) == -1) {
|
if (directory) {
|
||||||
|
if (chdir(directory) == -1) {
|
||||||
perror("chdir");
|
perror("chdir");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
g_free(directory);
|
||||||
|
}
|
||||||
|
|
||||||
GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue