1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-01 12:35:22 +00:00

Handle two more cases where dirname/basename may have returned NULL (adds to 91f8ceb20d)

This commit is contained in:
Mike Gelfand 2017-01-17 02:21:47 +03:00
parent a3654c65a5
commit 67bda2dcb8
2 changed files with 9 additions and 9 deletions

View file

@ -516,12 +516,15 @@ tr_getWebClientDir (const tr_session * session UNUSED)
module_path = tr_win32_native_to_utf8 (wide_module_path, -1);
dir = tr_sys_path_dirname (module_path, NULL);
tr_free (module_path);
s = tr_buildPath (dir, "Web", NULL);
tr_free (dir);
if (!isWebClientDir (s))
if (dir != NULL)
{
tr_free (s);
s = NULL;
s = tr_buildPath (dir, "Web", NULL);
tr_free (dir);
if (!isWebClientDir (s))
{
tr_free (s);
s = NULL;
}
}
}

View file

@ -2304,12 +2304,10 @@ loadBlocklists (tr_session * session)
else
{
char * binname;
char * basename;
tr_sys_path_info path_info;
tr_sys_path_info binname_info;
basename = tr_sys_path_basename (name, NULL);
binname = tr_strdup_printf ("%s" TR_PATH_DELIMITER_STR "%s.bin", dirname, basename);
binname = tr_strdup_printf ("%s" TR_PATH_DELIMITER_STR "%s.bin", dirname, name);
if (!tr_sys_path_get_info (binname, 0, &binname_info, NULL)) /* create it */
{
@ -2344,7 +2342,6 @@ loadBlocklists (tr_session * session)
tr_free (old);
}
tr_free (basename);
tr_free (binname);
}