Kaydet (Commit) 4049c77b authored tarafından Enrico Tröger's avatar Enrico Tröger

Fix not closed FILE pointer on early exit (patch by Daniel Marjamaki, thanks).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4986 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 9742a3ce
......@@ -3,6 +3,9 @@
* src/build.c:
Explicitly try to localise build menu item labels with
gettext to enforce getting default labels translated.
* tagmanager/tm_workspace.c:
Fix not closed FILE pointer on early exit
(patch by Daniel Marjamaki, thanks).
2010-05-30 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
......
......@@ -147,14 +147,17 @@ gboolean tm_workspace_load_global_tags(const char *tags_file, gint mode)
TMTag *tag;
gboolean format_pipe = FALSE;
if (NULL == (fp = g_fopen(tags_file, "r")))
return FALSE;
if (NULL == theWorkspace)
return FALSE;
if (NULL == (fp = g_fopen(tags_file, "r")))
return FALSE;
if (NULL == theWorkspace->global_tags)
theWorkspace->global_tags = g_ptr_array_new();
if ((NULL == fgets((gchar*) buf, BUFSIZ, fp)) || ('\0' == *buf))
{
fclose(fp);
return FALSE; /* early out on error */
}
else
{ /* We read the first line for the format specification. */
if (buf[0] == '#' && strstr((gchar*) buf, "format=pipe") != NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment