<HTML>
<BODY>
Hello!<br>
<br>
This code has memory leaks, either if theWorkspace is NULL or if the fopen fails.<br>
<br>
#ifdef G_OS_WIN32<br>
    char *temp_file = g_strdup_printf("%s\\_%d_%ld_1.cpp", config_dir, getpid(), time(NULL));<br>
    char *temp_file2 = g_strdup_printf("%s\\_%d_%ld_2.cpp", config_dir, getpid(), time(NULL));<br>
#else<br>
    char *temp_file = g_strdup_printf("%s/%d_%ld_1.cpp", config_dir, getpid(), time(NULL));<br>
    char *temp_file2 = g_strdup_printf("%s/%d_%ld_2.cpp", config_dir, getpid(), time(NULL));<br>
#endif<br>
<br>
    if (NULL == theWorkspace || NULL == (fp = g_fopen(temp_file, "w")))<br>
        return FALSE;<br>
<br>
I changed it to:<br>
<br>
#ifdef G_OS_WIN32<br>
    char *temp_file = g_strdup_printf("%s\\_%d_%ld_1.cpp", config_dir, getpid(), time(NULL));<br>
    char *temp_file2 = g_strdup_printf("%s\\_%d_%ld_2.cpp", config_dir, getpid(), time(NULL));<br>
#else<br>
    char *temp_file = g_strdup_printf("%s/%d_%ld_1.cpp", config_dir, getpid(), time(NULL));<br>
    char *temp_file2 = g_strdup_printf("%s/%d_%ld_2.cpp", config_dir, getpid(), time(NULL));<br>
#endif<br>
<br>
    if (NULL == theWorkspace || NULL == (fp = g_fopen(temp_file, "w")))<br>
    {<br>
        g_free(temp_file);<br>
        g_free(temp_file2);<br>
        return FALSE;<br>
    }<br>
<br>
Best regards,<br>
Daniel<br>
<div><div><br>
<br>
</div></div>
</BODY></HTML>


<P><p><font face="Arial, Helvetica, sans-serif" size="2" style="font-size:13.5px">_______________________________________________________________<BR>Parfym och kosmetik upp till 50% billigare hos BeautyPlanet.se - <a style="font-family: Tahoma, sans-serif; font-size: 12px; color: #00f" href="http://secure-dk.imrworldwide.com/cgi-bin/b?ci=aller-kampanj-se&cg=spray&tu=http%3A%2F%2Fwww.beautyplanet.se%2F%3Futm_source%3DSpray%26utm_medium%3DMailfooter%26utm_campaign%3DGenerell" target="_blank"> Klicka här!</a></font>