mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix uses of putenv.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5919 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -373,7 +373,9 @@ gnc_timegm (struct tm *tm)
|
||||
put_str = g_strdup_printf ("TZ=%s", old_tz ? old_tz : "");
|
||||
putenv (put_str);
|
||||
|
||||
g_free (put_str);
|
||||
/* We can't free put_str since it is used directly.
|
||||
* This is a memory leak, but how to solve it? *?
|
||||
/* g_free (put_str); */
|
||||
g_free (old_tz);
|
||||
|
||||
return result;
|
||||
|
||||
@@ -91,7 +91,6 @@ test_file(const char *filename)
|
||||
|
||||
putenv_str = g_strdup_printf ("%s=%s", "LANG", possible_envs[i]);
|
||||
putenv (putenv_str);
|
||||
g_free (putenv_str);
|
||||
|
||||
new_session = gnc_session_new();
|
||||
|
||||
@@ -163,7 +162,6 @@ main(int argc, char **argv)
|
||||
|
||||
putenv_str = g_strdup_printf ("%s=%s", "LANG", base_env);
|
||||
putenv (putenv_str);
|
||||
g_free (putenv_str);
|
||||
|
||||
if(!S_ISDIR(file_info.st_mode))
|
||||
{
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
* Copyright 2001 Linux Developers Group, Inc.
|
||||
*************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
@@ -129,7 +131,7 @@ gnc_module_system_setup_load_path(void)
|
||||
g_list_free(dirs);
|
||||
|
||||
put_str = g_strdup_printf ("LD_LIBRARY_PATH=%s", envt);
|
||||
if(putenv(put_str) == -1)
|
||||
if (putenv(put_str) != 0)
|
||||
{
|
||||
g_warning ("gnc-module failed to set LD_LIBRARY_PATH");
|
||||
}
|
||||
|
||||
@@ -84,14 +84,12 @@ gnucash_main_helper (int argc, char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(putenv(string) != 0) {
|
||||
if (putenv(string) != 0) {
|
||||
FATAL("putenv(%s) failed. Aborting.\n", string);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
bootstrap_scm = GNC_BOOTSTRAP_SCM;
|
||||
|
||||
g_free(string);
|
||||
}
|
||||
|
||||
PINFO("bootstrap file is %s\n", bootstrap_scm);
|
||||
@@ -103,7 +101,6 @@ gnucash_main_helper (int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(run_as_shell) {
|
||||
int scm_argc = argc + 1;
|
||||
char **scm_argv = g_malloc(scm_argc * sizeof(char *));
|
||||
|
||||
Reference in New Issue
Block a user