ctld: Catch exceptions by reference instead of by value

Reported by:	GCC -Wcatch-value
Sponsored by:	Chelsio Communications
This commit is contained in:
John Baldwin 2025-08-07 17:11:22 -04:00
parent e3ac01e18e
commit ab328f4e33
2 changed files with 2 additions and 2 deletions

View file

@ -466,7 +466,7 @@ parse_conf(const char *path)
bool parsed;
try {
parsed = yyparse_conf(fp.get());
} catch (std::bad_alloc) {
} catch (std::bad_alloc &) {
log_warnx("failed to allocate memory parsing %s", path);
return (false);
} catch (...) {

View file

@ -1418,7 +1418,7 @@ uclparse_conf(const char *path)
bool parsed;
try {
parsed = uclparse_toplevel(top);
} catch (std::bad_alloc) {
} catch (std::bad_alloc &) {
log_warnx("failed to allocate memory parsing %s", path);
parsed = false;
} catch (...) {