diff --git a/libtransmission/platform.c b/libtransmission/platform.c index 2743c8e7d..3a7eed86c 100644 --- a/libtransmission/platform.c +++ b/libtransmission/platform.c @@ -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; + } } } diff --git a/libtransmission/session.c b/libtransmission/session.c index f21d18e20..944dde2ad 100644 --- a/libtransmission/session.c +++ b/libtransmission/session.c @@ -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); }