8000 Fix filling and releasing of black_list · postgrespro/pg_probackup@a428956 · GitHub
[go: up one dir, main page]

Skip to content

Commit a428956

Browse files
committed
Fix filling and releasing of black_list
1 parent 31830df commit a428956

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/dir.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ dir_list_file(parray *files, const char *root, bool exclude, bool omit_symlink,
415415

416416
while (fgets(buf, lengthof(buf), black_list_file) != NULL)
417417
{
418+
black_item[0] = '\0';
418419
join_path_components(black_item, instance_config.pgdata, buf);
419420

420421
if (black_item[strlen(black_item) - 1] == '\n')
@@ -423,7 +424,7 @@ dir_list_file(parray *files, const char *root, bool exclude, bool omit_symlink,
423424
if (black_item[0] == '#' || black_item[0] == '\0')
424425
continue;
425426

426-
parray_append(black_list, black_item);
427+
parray_append(black_list, pgut_strdup(black_item));
427428
}
428429

429430
fclose(black_list_file);
@@ -446,6 +447,12 @@ dir_list_file(parray *files, const char *root, bool exclude, bool omit_symlink,
446447

447448
if (!add_root)
448449
pgFileFree(file);
450+
451+
if (black_list)
452+
{
453+
parray_walk(black_list, pfree);
454+
parray_free(black_list);
455+
}
449456
}
450457

451458
#define CHECK_FALSE 0

0 commit comments

Comments
 (0)
0