Skip to content

Commit

Permalink
Merge pull request proftpd#1306 from proftpd/config-dump-iter-pool
Browse files Browse the repository at this point in the history
Use a scratch iter pool when dumping the configuration, rather than u…
  • Loading branch information
Castaglia authored Aug 16, 2021
2 parents ffc44ac + c3b4682 commit 0bac0b9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/configdb.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ProFTPD - FTP server daemon
* Copyright (c) 2014-2020 The ProFTPD Project team
* Copyright (c) 2014-2021 The ProFTPD Project team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -205,7 +205,12 @@ void pr_config_dump(void (*dumpf)(const char *, ...), xaset_t *s,
}

if (c->subset) {
pr_config_dump(dumpf, c->subset, pstrcat(c->pool, indent, " ", NULL));
pool *iter_pool;

iter_pool = make_sub_pool(c->pool);
pr_pool_tag(iter_pool, "config dump scratch pool");
pr_config_dump(dumpf, c->subset, pstrcat(iter_pool, indent, " ", NULL));
destroy_pool(iter_pool);
}
}
}
Expand Down

0 comments on commit 0bac0b9

Please sign in to comment.