fix coverity warnings

This commit is contained in:
Brad Parker 2018-01-26 00:14:59 -05:00
parent 16cccb8796
commit 9ef75473e0
2 changed files with 12 additions and 2 deletions

View File

@ -2285,6 +2285,8 @@ static void frontend_unix_watch_path_for_changes(struct string_list *list, int f
free(*change_data); free(*change_data);
return; return;
} }
else
return;
} }
else if (list->size == 0) else if (list->size == 0)
return; return;
@ -2344,7 +2346,11 @@ static void frontend_unix_watch_path_for_changes(struct string_list *list, int f
return; return;
} }
socket_nonblock(fd); if (!socket_nonblock(fd))
{
RARCH_WARN("watch_path_for_changes: Could not set socket to non-blocking.\n");
return;
}
inotify_data = (inotify_data_t*)calloc(1, sizeof(*inotify_data)); inotify_data = (inotify_data_t*)calloc(1, sizeof(*inotify_data));
inotify_data->fd = fd; inotify_data->fd = fd;
@ -2391,7 +2397,7 @@ static bool frontend_unix_check_for_path_changes(path_change_data_t *change_data
{ {
i = 0; i = 0;
while (i < length) while (i < length && i < sizeof(buffer))
{ {
struct inotify_event *event = (struct inotify_event *)&buffer[i]; struct inotify_event *event = (struct inotify_event *)&buffer[i];

View File

@ -799,7 +799,11 @@ bool video_shader_read_conf_cgp(config_file_t *conf,
for (i = 0; i < shader->passes; i++) for (i = 0; i < shader->passes; i++)
{ {
if (!video_shader_parse_pass(conf, &shader->pass[i], i)) if (!video_shader_parse_pass(conf, &shader->pass[i], i))
{
if (file_list)
string_list_free(file_list);
return false; return false;
}
if (settings->bools.video_shader_watch_files) if (settings->bools.video_shader_watch_files)
{ {