From: Francis Dupont Date: Wed, 25 Nov 2015 10:27:55 +0000 (+0100) Subject: [4097a] Added a no subnet check in buildCfgOptionList() X-Git-Tag: trac4204fd_base~2^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d40a3b41144e4322f65765220ee821c9adaf383a;p=thirdparty%2Fkea.git [4097a] Added a no subnet check in buildCfgOptionList() --- diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index 11decc3d3d..878bcec58b 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -827,7 +827,12 @@ Dhcpv4Srv::buildCfgOptionList(Dhcpv4Exchange& ex) { // First subnet configured options Subnet4Ptr subnet = ex.getContext()->subnet_; - if (subnet && !subnet->getCfgOption()->empty()) { + if (!subnet) { + // All methods using the CfgOptionList object return soon when + // there is no subnet so do the same + return; + } + if (!subnet->getCfgOption()->empty()) { co_list.push_back(subnet->getCfgOption()); }