summaryrefslogtreecommitdiff
path: root/io/fts.c
diff options
context:
space:
mode:
Diffstat (limited to 'io/fts.c')
-rw-r--r--io/fts.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io/fts.c b/io/fts.c
index f0df56cc7b..bf182992c2 100644
--- a/io/fts.c
+++ b/io/fts.c
@@ -120,7 +120,8 @@ fts_open(argv, options, compar)
#ifndef MAXPATHLEN
#define MAXPATHLEN 1024
#endif
- if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
+ size_t maxarglen = fts_maxarglen(argv);
+ if (fts_palloc(sp, MAX(maxarglen, MAXPATHLEN)))
goto mem1;
/* Allocate/initialize root's parent. */