child-cfg: Allow passing NULL as proposal to add_proposal()
[strongswan.git] / src / libcharon / config / child_cfg.c
index 8d8214e..3f07b58 100644 (file)
@@ -149,7 +149,10 @@ METHOD(child_cfg_t, get_name, char*,
 METHOD(child_cfg_t, add_proposal, void,
        private_child_cfg_t *this, proposal_t *proposal)
 {
-       this->proposals->insert_last(this->proposals, proposal);
+       if (proposal)
+       {
+               this->proposals->insert_last(this->proposals, proposal);
+       }
 }
 
 METHOD(child_cfg_t, get_proposals, linked_list_t*,