SF.net SVN: geany-plugins:[1214] trunk/geanylatex/src/geanylatex.c
frlan at users.sourceforge.net
frlan at xxxxx
Sat Mar 27 14:34:12 UTC 2010
Revision: 1214
http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1214&view=rev
Author: frlan
Date: 2010-03-27 14:34:12 +0000 (Sat, 27 Mar 2010)
Log Message:
-----------
GeanyLaTeX: Fix a memory leak on date handling of wizard
Modified Paths:
--------------
trunk/geanylatex/src/geanylatex.c
Modified: trunk/geanylatex/src/geanylatex.c
===================================================================
--- trunk/geanylatex/src/geanylatex.c 2010-03-27 14:33:49 UTC (rev 1213)
+++ trunk/geanylatex/src/geanylatex.c 2010-03-27 14:34:12 UTC (rev 1214)
@@ -1584,17 +1584,19 @@
g_free(author_string);
}
- if (date != NULL)
+ if (NZV(date))
{
- if (date[0] != '\0')
- {
- date = g_strconcat("\\date{", date, "}\n", NULL);
- utils_string_replace_all(code, "{DATE}", date);
- }
- else
- utils_string_replace_all(code, "{DATE}", "\% \\date{}\n");
+ gchar *date_string = NULL;
+ date_string = g_strconcat("\\date{", date, "}\n", NULL);
+ utils_string_replace_all(code, "{DATE}", date_string);
g_free(date);
+ g_free(date_string);
}
+ else
+ {
+ utils_string_replace_all(code, "{DATE}", "\% \\date{}\n");
+ }
+
if (title != NULL)
{
if (title[0] != '\0')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Plugins-Commits
mailing list