diff options
author | Jim Meyering <jim@meyering.net> | 2003-02-28 14:44:34 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-02-28 14:44:34 +0000 |
commit | ad9e0f6824ed5ed135c1f086b78d173e52fd5c7f (patch) | |
tree | d626fcf69b849f2f723eab23e16542a3f8a3b0d5 | |
parent | e660be4d86eba890be6d31ebcd96bb15ac57ebca (diff) | |
download | coreutils-ad9e0f6824ed5ed135c1f086b78d173e52fd5c7f.tar.xz |
(ftw_startup): Return -1 if alloca fails.
-rw-r--r-- | lib/ftw.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -657,6 +657,8 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors, data.actdir = 0; data.dirstreams = (struct dir_data **) alloca (data.maxdir * sizeof (struct dir_data *)); + if (data.dirstreams == NULL) + return -1; memset (data.dirstreams, '\0', data.maxdir * sizeof (struct dir_data *)); /* PATH_MAX is always defined when we get here. */ |