Very recently fossil_getenv function was introduced as a wrapper
around standard getenv to get Unicode right.
In file.c:

/*
** Return the value of an environment variable as UTF8.
*/
char *fossil_getenv(const char *zName){
  char *zValue = getenv(zName);
#ifdef _WIN32
  if( zValue ) zValue = fossil_mbcs_to_utf8(zValue);
#endif
  return zValue;
}

In Unix it returns pointer pointing into actual environment (should
not be modified or deallocated). In Windows, on the other hand,
fossil_mbcs_to_utf8 allocates memory via sqlite3_malloc. This memory
is not and cannot not be freed because of UNIX behavior.
It results in memory leak on Windows. Should one care?

--Leo--
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to