[gnome-builder] clang: don't leak file path
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] clang: don't leak file path
- Date: Thu, 13 Oct 2016 01:39:40 +0000 (UTC)
commit 6aa7fdaee7c91f8f10c4634f4a2539d60e26a967
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 12 18:39:31 2016 -0700
clang: don't leak file path
plugins/clang/ide-clang-service.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/clang/ide-clang-service.c b/plugins/clang/ide-clang-service.c
index 0245de3..17128e6 100644
--- a/plugins/clang/ide-clang-service.c
+++ b/plugins/clang/ide-clang-service.c
@@ -368,12 +368,12 @@ ide_clang_service_get_translation_unit_worker (EggTaskCache *cache,
gpointer user_data)
{
g_autoptr(GTask) real_task = NULL;
+ g_autofree gchar *path = NULL;
IdeClangService *self = user_data;
IdeUnsavedFiles *unsaved_files;
IdeBuildSystem *build_system;
ParseRequest *request;
IdeContext *context;
- const gchar *path;
IdeFile *file = (IdeFile *)key;
GFile *gfile;
@@ -402,7 +402,7 @@ ide_clang_service_get_translation_unit_worker (EggTaskCache *cache,
*/
request->file = ide_file_new (context, gfile);
request->index = self->index;
- request->source_filename = g_strdup (path);
+ request->source_filename = g_steal_pointer (&path);
request->command_line_args = NULL;
request->unsaved_files = ide_unsaved_files_to_array (unsaved_files);
request->sequence = ide_unsaved_files_get_sequence (unsaved_files);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]