From 293ba9bee7054e16109e66a22d610618e4f9c561 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Wed, 30 Jun 2010 11:49:05 +0000 Subject: [PATCH] =?UTF-8?q?Use=20g=5Ffree=20instead=20of=20free=20(patch?= =?UTF-8?q?=20by=20Daniel=20Marjam=C3=A4ki,=20thanks).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5074 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 2 ++ tagmanager/get.c | 4 ++-- tagmanager/tm_workspace.c | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66938e65..0d3b4ca2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * src/highlighting.c: Re-enable fold.comment for the C lexer - it was disabled to prevent //{ explicit folding, but that also disables stream comments /* */. + * tagmanager/tm_workspace.c, tagmanager/get.c: + Use g_free instead of free (patch by Daniel Marjamäki, thanks). 2010-06-29 Nick Treleaven diff --git a/tagmanager/get.c b/tagmanager/get.c index 89b402ba..e2d79aa3 100644 --- a/tagmanager/get.c +++ b/tagmanager/get.c @@ -710,7 +710,7 @@ extern char *getArglistFromBufferPos(int startPosition, const char *tokenName) memcpy(result, &File.fpBuffer[getBufPos()], pos2 - pos1 + 1); result[pos2-pos1+1] = '\0'; arglist = getArglistFromStr(result, tokenName); - free(result); + g_free(result); } } setBufPos (bufferOriginalPosition); @@ -737,8 +737,8 @@ extern char *getArglistFromFilePos(fpos_t startPosition, const char *tokenName) { result[pos2-pos1+1] = '\0'; arglist = getArglistFromStr(result, tokenName); - free(result); } + g_free(result); } fsetpos(File.fp, &originalPosition); return arglist; diff --git a/tagmanager/tm_workspace.c b/tagmanager/tm_workspace.c index 559bdf30..6a1f8490 100644 --- a/tagmanager/tm_workspace.c +++ b/tagmanager/tm_workspace.c @@ -226,7 +226,7 @@ static void write_includes_file(FILE *fp, GList *includes_files) size_t size; size = fwrite(str, str_len, 1, fp); - free(str); + g_free(str); node = g_list_next (node); } } @@ -302,6 +302,7 @@ gboolean tm_workspace_create_global_tags(const char *config_dir, const char *pre { int dirty_len = strlen(includes[idx_inc]); char *clean_path = g_malloc(dirty_len - 1); + strncpy(clean_path, includes[idx_inc] + 1, dirty_len - 1); clean_path[dirty_len - 2] = 0; @@ -331,7 +332,7 @@ gboolean tm_workspace_create_global_tags(const char *config_dir, const char *pre } } globfree(&globbuf); - free(clean_path); + g_free(clean_path); } else #endif