diff --git a/frontend/drivers/platform_unix.c b/frontend/drivers/platform_unix.c index 6f6015ed1a..1262709da3 100644 --- a/frontend/drivers/platform_unix.c +++ b/frontend/drivers/platform_unix.c @@ -2285,6 +2285,8 @@ static void frontend_unix_watch_path_for_changes(struct string_list *list, int f free(*change_data); return; } + else + return; } else if (list->size == 0) return; @@ -2344,7 +2346,11 @@ static void frontend_unix_watch_path_for_changes(struct string_list *list, int f 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->fd = fd; @@ -2391,7 +2397,7 @@ static bool frontend_unix_check_for_path_changes(path_change_data_t *change_data { i = 0; - while (i < length) + while (i < length && i < sizeof(buffer)) { struct inotify_event *event = (struct inotify_event *)&buffer[i]; diff --git a/gfx/video_shader_parse.c b/gfx/video_shader_parse.c index d4160fd4a9..e19abc7290 100644 --- a/gfx/video_shader_parse.c +++ b/gfx/video_shader_parse.c @@ -799,7 +799,11 @@ bool video_shader_read_conf_cgp(config_file_t *conf, for (i = 0; i < shader->passes; i++) { if (!video_shader_parse_pass(conf, &shader->pass[i], i)) + { + if (file_list) + string_list_free(file_list); return false; + } if (settings->bools.video_shader_watch_files) {