min_level = get_type (loglevel);
if (logfile == NULL)
return GNUNET_OK;
- altlog = fopen (logfile, "a");
+ altlog = FOPEN (logfile, "a");
if (altlog == NULL)
{
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", logfile);
tmpdir = getenv ("TMPDIR");
tmpdir = tmpdir ? tmpdir : "/tmp";
- GNUNET_asprintf (&tmpl, "%s%s%s%s", tmpdir, DIR_SEPARATOR_STR, t, "XXXXXX");
+ GNUNET_asprintf (&tmpl, "%s/%s%s", tmpdir, t, "XXXXXX");
#ifdef MINGW
fn = (char *) GNUNET_malloc (MAX_PATH + 1);
- plibc_conv_to_win_path (tmpl, fn);
+ if (ERROR_SUCCESS != plibc_conv_to_win_path (tmpl, fn))
+ {
+ GNUNET_free (fn);
+ GNUNET_free (tmpl);
+ return NULL;
+ }
GNUNET_free (tmpl);
#else
fn = tmpl;
#endif
expfn = GNUNET_STRINGS_filename_expand (fn);
+ if (NULL == expfn)
+ return NULL;
#ifndef MINGW
mode = 0;