Merge pull request #2594 from ctult/master

a bit of static analysis
This commit is contained in:
Twinaphex 2015-12-25 07:09:50 +01:00
commit 9640520c63
5 changed files with 17 additions and 6 deletions

View File

@ -2126,7 +2126,7 @@ bool config_load_remap(void)
if (!core_name || !game_name) if (!core_name || !game_name)
return false; return false;
if (core_name[0] == '\0' || game_name == '\0') if (core_name[0] == '\0' || game_name[0] == '\0')
return false; return false;
RARCH_LOG("Remaps: core name: %s\n", core_name); RARCH_LOG("Remaps: core name: %s\n", core_name);

View File

@ -634,10 +634,11 @@ bool rarch_environment_cb(unsigned cmd, void *data)
{ {
struct retro_variable *var = (struct retro_variable*)data; struct retro_variable *var = (struct retro_variable*)data;
RARCH_LOG("Environ GET_VARIABLE %s:\n", var->key); if (var) {
if (var) RARCH_LOG("Environ GET_VARIABLE %s:\n", var->key);
var->value = NULL; var->value = NULL;
RARCH_LOG("\t%s\n", var->value ? var->value : "N/A"); RARCH_LOG("\t%s\n", var->value ? var->value : "N/A");
}
} }
break; break;

View File

@ -757,8 +757,12 @@ static struct android_app* android_app_create(ANativeActivity* activity,
if (pipe(msgpipe)) if (pipe(msgpipe))
{ {
RARCH_ERR("could not create pipe: %s.\n", strerror(errno)); RARCH_ERR("could not create pipe: %s.\n", strerror(errno));
if(android_app->savedState)
free(android_app->savedState);
free(android_app);
return NULL; return NULL;
} }
android_app->msgread = msgpipe[0]; android_app->msgread = msgpipe[0];
android_app->msgwrite = msgpipe[1]; android_app->msgwrite = msgpipe[1];

View File

@ -176,6 +176,7 @@ void system_exec_wii(const char *_path, bool should_load_game)
/* don't use memcpy, there might be an overlap. */ /* don't use memcpy, there might be an overlap. */
memmove(EXECUTE_ADDR, dol, size); memmove(EXECUTE_ADDR, dol, size);
DCFlushRange(EXECUTE_ADDR, size); DCFlushRange(EXECUTE_ADDR, size);
free(dol);
dol_copy_argv_path(path, should_load_game ? game_path : NULL); dol_copy_argv_path(path, should_load_game ? game_path : NULL);

View File

@ -359,8 +359,12 @@ static void set_paths_redirect(const char *path)
rarch_system_info_t *info = NULL; rarch_system_info_t *info = NULL;
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info); runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info);
if (!global)
if (global && info->info.library_name && {
RARCH_WARN("set_paths_redirect was sent a NULL \"global\" pointer.");
return;
}
if (info->info.library_name &&
(info->info.library_name[0] != '\0')) (info->info.library_name[0] != '\0'))
global_library_name_hash = msg_hash_calculate(info->info.library_name); global_library_name_hash = msg_hash_calculate(info->info.library_name);
@ -1638,6 +1642,7 @@ int rarch_defer_core(void *data, const char *dir,
} }
else else
#endif #endif
if (info)
strlcpy(new_core_path, info->path, sizeof(new_core_path)); strlcpy(new_core_path, info->path, sizeof(new_core_path));
/* There are multiple deferred cores and a /* There are multiple deferred cores and a