We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf22792 commit f1e9f6bCopy full SHA for f1e9f6b
src/common/rmtree.c
@@ -55,7 +55,7 @@ rmtree(const char *path, bool rmtopdir)
55
bool result = true;
56
size_t dirnames_size = 0;
57
size_t dirnames_capacity = 8;
58
- char **dirnames = palloc(sizeof(char *) * dirnames_capacity);
+ char **dirnames;
59
60
dir = OPENDIR(path);
61
if (dir == NULL)
@@ -64,6 +64,8 @@ rmtree(const char *path, bool rmtopdir)
64
return false;
65
}
66
67
+ dirnames = (char **) palloc(sizeof(char *) * dirnames_capacity);
68
+
69
while (errno = 0, (de = readdir(dir)))
70
{
71
if (strcmp(de->d_name, ".") == 0 ||
0 commit comments