aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2015-02-06 02:33:02 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2015-02-06 02:33:02 +0000
commit2d4c4fca2583bbc54bc3f76daca1b93d922391c7 (patch)
tree7e100aa81a3dc4ebc1901d6d71eb2df1766eec28
parentdc3e933ec4b73ac93ae866bb979f02045181a17f (diff)
Fixed _s_tempnam().
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3463 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog5
-rw-r--r--libsylph/utils.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 85b6cf44..c8df05f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-06
+
+ * libsylph/utils.c: _s_tempnam(): memory allocated by _wtempnam()
+ must be freed by MSVCRT, not by GLib (thanks to Gisle Vanem).
+
2015-01-16
* src/gtkutils.c: gtkut_text_buffer_insert_with_tag_by_name():
diff --git a/libsylph/utils.c b/libsylph/utils.c
index 3c54611c..0faf6b48 100644
--- a/libsylph/utils.c
+++ b/libsylph/utils.c
@@ -3745,7 +3745,8 @@ gchar *_s_tempnam(const gchar *dir, const gchar *prefix)
save_errno = EINVAL;
}
- g_free(wname);
+ free(wname); /* must be freed by same MSVCRT used for
+ _wtempnam() */
g_free(wprefix);
g_free(wpath);
@@ -3779,7 +3780,7 @@ gchar *_s_tempnam(const gchar *dir, const gchar *prefix)
save_errno = EINVAL;
}
- g_free(cp_name);
+ free(cp_name);
g_free(cp_prefix);
g_free(cp_path);