[gitg] Fixed misuse of tmpname as tmp index name when it was already freed
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Subject: [gitg] Fixed misuse of tmpname as tmp index name when it was already freed
- Date: Sun, 5 Jul 2009 18:32:38 +0000 (UTC)
commit e17dbf00e768ab0892175822b3907e3a1ec466f3
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Sun Jul 5 20:32:12 2009 +0200
Fixed misuse of tmpname as tmp index name when it was already freed
gitg/gitg-branch-actions.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gitg/gitg-branch-actions.c b/gitg/gitg-branch-actions.c
index 4412db9..c5a5267 100644
--- a/gitg/gitg-branch-actions.c
+++ b/gitg/gitg-branch-actions.c
@@ -654,7 +654,6 @@ stash_changes_real (GitgWindow *window, gchar **ref, gboolean storeref)
}
GFile *customindex = g_file_new_for_path (tmpname);
- g_free (tmpname);
close (fd);
@@ -676,7 +675,9 @@ stash_changes_real (GitgWindow *window, gchar **ref, gboolean storeref)
goto cleanup;
}
+ tmpname = g_file_get_path (customindex);
gitg_runner_add_environment (runner, "GIT_INDEX_FILE", tmpname);
+ g_free (tmpname);
gboolean writestash;
@@ -690,9 +691,10 @@ stash_changes_real (GitgWindow *window, gchar **ref, gboolean storeref)
g_file_delete (customindex, NULL, NULL);
g_object_unref (customindex);
+ gitg_runner_set_environment (runner, NULL);
+
if (!writestash)
{
- g_object_unref (customindex);
ret = FALSE;
showerror = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]