Strdup access
This commit is contained in:
parent
faa5d7ca4b
commit
12d5bdc738
@ -488,6 +488,8 @@ void dijkstra_solver_free(struct dijkstra_solver *solver)
|
||||
for (l = solver->net_metas; l != NULL; l = l->next) {
|
||||
net_meta = (struct dijkstra_net_meta*) l->data;
|
||||
free(net_meta->name);
|
||||
if (net_meta->access)
|
||||
free(net_meta->access);
|
||||
free(net_meta);
|
||||
}
|
||||
}
|
||||
@ -549,7 +551,10 @@ struct dijkstra_net_meta *dijkstra_net_meta_new(enum dijkstra_net_type net_type,
|
||||
if (net_meta) {
|
||||
net_meta->type = net_type;
|
||||
net_meta->name = strdup(name);
|
||||
net_meta->access = access;
|
||||
if (access)
|
||||
net_meta->access = strdup(access);
|
||||
else
|
||||
net_meta->access = NULL;
|
||||
}
|
||||
|
||||
return net_meta;
|
||||
|
Loading…
Reference in New Issue
Block a user