free the directory argument
This commit is contained in:
parent
f327726f88
commit
9faaf34665
11
termite.cc
11
termite.cc
|
@ -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,9 +1190,12 @@ int main(int argc, char **argv) {
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (directory && chdir(directory) == -1) {
|
if (directory) {
|
||||||
perror("chdir");
|
if (chdir(directory) == -1) {
|
||||||
return EXIT_FAILURE;
|
perror("chdir");
|
||||||
|
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