[vlc-commits] ncurses: Remove use of xstrdup
Hugo Beauzée-Luyssen
git at videolan.org
Wed Aug 22 11:44:39 CEST 2018
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Aug 21 18:37:12 2018 +0200| [73a2988ec48d6752054afa550aab26abbf3f6b77] | committer: Hugo Beauzée-Luyssen
ncurses: Remove use of xstrdup
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=73a2988ec48d6752054afa550aab26abbf3f6b77
---
modules/gui/ncurses.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index a1aa39a4f5..eb3d5c5bbf 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -294,7 +294,12 @@ static void ReadDir(intf_thread_t *intf)
continue;
dir_entry->file = IsFile(sys->current_dir, entry);
- dir_entry->path = xstrdup(entry);
+ dir_entry->path = strdup(entry);
+ if (unlikely(dir_entry->path == NULL))
+ {
+ free(dir_entry);
+ continue;
+ }
TAB_APPEND(sys->n_dir_entries, sys->dir_entries, dir_entry);
continue;
}
More information about the vlc-commits
mailing list