static gboolean
_set_environment (TlmSessionPrivate *priv)
{
- gchar **envlist = tlm_auth_session_get_envlist(priv->auth_session);
+ gchar **envlist = tlm_auth_session_get_envlist(priv->auth_session);
gchar *home_dir = NULL, *shell = NULL;
if (envlist) {
for (env = envlist; *env != NULL; ++env) {
DBG ("ENV : %s", *env);
putenv(*env);
- g_free (*env);
+ // Don't free *env because putenv uses pointer internally without copying the string.
}
g_free (envlist);
}