[sylpheed:36274] free() on _wtempnam()

Gisle Vanem gvanem at yahoo.no
Fri Feb 6 03:30:11 JST 2015


I've built Sylpheed with MSVC v16 for several years and all
has been well until I switched to Win-8.1 and VS-Express 2013
(MSVC v18). Here I got crashes in libsylph/utils.c due to a
possible mixture of CRTs in Glib and Sylpheed.

I assume MSVC120.DLL is more strict in some way. But I don't
understand all the details, but bottom line is I found a fix
that works for me; this memory:
   wname = _wtempnam(wpath, wprefix);  (line 3740)

MUST be free'd by MSVCRT and not by Glib. Hence:

--- a/libsylph/utils.c 2015-02-05 17:28:48 +0000
+++ b/libsylphutils.c  2015-02-05 18:41:54 +0000
@@ -3745,7 +3745,7 @@
                         save_errno = EINVAL;
                 }

-               g_free(wname);
+               free(wname);
                 g_free(wprefix);
                 g_free(wpath);

-----------

Anybody who can comment on this?

-- 
--gv


More information about the Sylpheed mailing list