Added a null-safe strdup variant
This commit is contained in:
@@ -536,7 +536,7 @@ child_cfg_t *child_cfg_create(char *name, lifetime_cfg_t *lifetime,
|
||||
.destroy = _destroy,
|
||||
},
|
||||
.name = strdup(name),
|
||||
.updown = updown ? strdup(updown) : NULL,
|
||||
.updown = strdupnull(updown),
|
||||
.hostaccess = hostaccess,
|
||||
.mode = mode,
|
||||
.start_action = start_action,
|
||||
|
||||
@@ -682,7 +682,7 @@ peer_cfg_t *peer_cfg_create(char *name, u_int ike_version, ike_cfg_t *ike_cfg,
|
||||
this->use_mobike = mobike;
|
||||
this->dpd = dpd;
|
||||
this->virtual_ip = virtual_ip;
|
||||
this->pool = pool ? strdup(pool) : NULL;
|
||||
this->pool = strdupnull(pool);
|
||||
this->local_auth = linked_list_create();
|
||||
this->remote_auth = linked_list_create();
|
||||
this->refcount = 1;
|
||||
|
||||
Reference in New Issue
Block a user