* lib/fts.c (fts_read): Set errno==ENOMEM and return NULL
when setup_dir() fails, rather than hitting an assertion later.
+2023-02-27 ChuanGang Jiang <jiangchuanganghw@outlook.com>
+
+ fts: fail gracefully when out of memory
+ * lib/fts.c (fts_read): Set errno==ENOMEM and return NULL
+ when setup_dir() fails, rather than hitting an assertion later.
+
2023-02-26 Bruno Haible <bruno@clisp.org>
dfa: Avoid warnings with some Apple clang versions.
/* Traverse a file hierarchy.
- Copyright (C) 2004-2022 Free Software Foundation, Inc.
+ Copyright (C) 2004-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
free_dir(sp);
fts_load(sp, p);
- setup_dir(sp);
+ if (! setup_dir(sp)) {
+ free_dir(sp);
+ __set_errno (ENOMEM);
+ return (NULL);
+ }
goto check_for_dir;
}