Skip to content

Commit d1b5c57

Browse files
Fix parray_new() memory leak (#240)
1 parent 7cb5b1d commit d1b5c57

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

backup.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
480480
}
481481
}
482482
parray_concat(files, snapshot_files);
483+
parray_free(snapshot_files);
483484
}
484485

485486
/*
@@ -2071,6 +2072,8 @@ add_files(parray *files, const char *root, bool add_root, bool is_pgdata)
20712072
file->is_datafile = true;
20722073
}
20732074
parray_concat(files, list_file);
2075+
2076+
parray_free(list_file);
20742077
}
20752078

20762079
/*

delete.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ int do_purge(void)
501501
else
502502
elog(INFO, _("DELETED backup \"%s\" is purged"), timestamp);
503503
}
504+
505+
parray_free(files);
504506
}
505507
return 0;
506508
}

dir.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ dir_list_file(parray *files, const char *root, const char *exclude[], bool omit_
293293
fclose(black_list_file);
294294
parray_qsort(black_list, BlackListCompare);
295295
dir_list_file_internal(files, root, exclude, omit_symlink, add_root, black_list);
296+
297+
parray_free(black_list);
296298
}
297299
else
298300
dir_list_file_internal(files, root, exclude, omit_symlink, add_root, NULL);

0 commit comments

Comments
 (0)