diff --git a/daemon/vc-utils.c b/daemon/vc-utils.c index 29a8cee4..3eb0177e 100644 --- a/daemon/vc-utils.c +++ b/daemon/vc-utils.c @@ -676,8 +676,6 @@ do_check_file_locked (const char *path, const char *worktree, gboolean locked_on ret = TRUE; goto out; } - g_free (tmp_name); - g_free (fullpath); /* Sometimes the first two characters are replaced by ~$. */ @@ -685,6 +683,8 @@ do_check_file_locked (const char *path, const char *worktree, gboolean locked_on goto out; char *ptr = g_utf8_find_next_char(g_utf8_find_next_char (file_name, NULL), NULL); + g_free (tmp_name); + g_free (fullpath); tmp_name = g_strconcat ("~$", ptr, NULL); fullpath = g_build_path ("/", worktree, dir_name, tmp_name, NULL); if (g_file_test (fullpath, G_FILE_TEST_IS_REGULAR)) {