ike-cfg: Allow passing NULL to add_proposal()

This simplifies adding default proposals with constructors potentially
returning NULL.
This commit is contained in:
Martin Willi
2014-05-16 16:01:21 +02:00
parent 8642f8bdb7
commit 3312c447ef
2 changed files with 7 additions and 3 deletions
+4 -1
View File
@@ -281,7 +281,10 @@ METHOD(ike_cfg_t, get_dscp, u_int8_t,
METHOD(ike_cfg_t, add_proposal, void,
private_ike_cfg_t *this, proposal_t *proposal)
{
this->proposals->insert_last(this->proposals, proposal);
if (proposal)
{
this->proposals->insert_last(this->proposals, proposal);
}
}
METHOD(ike_cfg_t, get_proposals, linked_list_t*,