diff --git a/usr.sbin/ctld/conf.cc b/usr.sbin/ctld/conf.cc index ab76f8e2ed0..56a149a58a2 100644 --- a/usr.sbin/ctld/conf.cc +++ b/usr.sbin/ctld/conf.cc @@ -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 (...) { diff --git a/usr.sbin/ctld/uclparse.cc b/usr.sbin/ctld/uclparse.cc index cb3b0a17cd7..8a62636ffec 100644 --- a/usr.sbin/ctld/uclparse.cc +++ b/usr.sbin/ctld/uclparse.cc @@ -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 (...) {