Strdup access

wip/bound-for
Markus Koch 2021-03-04 22:00:44 +01:00
parent faa5d7ca4b
commit 12d5bdc738
1 changed files with 6 additions and 1 deletions

View File

@ -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;