Strdup access

This commit is contained in:
Markus Koch 2021-03-04 22:00:44 +01:00
parent faa5d7ca4b
commit 12d5bdc738

View File

@ -488,6 +488,8 @@ void dijkstra_solver_free(struct dijkstra_solver *solver)
for (l = solver->net_metas; l != NULL; l = l->next) { for (l = solver->net_metas; l != NULL; l = l->next) {
net_meta = (struct dijkstra_net_meta*) l->data; net_meta = (struct dijkstra_net_meta*) l->data;
free(net_meta->name); free(net_meta->name);
if (net_meta->access)
free(net_meta->access);
free(net_meta); free(net_meta);
} }
} }
@ -549,7 +551,10 @@ struct dijkstra_net_meta *dijkstra_net_meta_new(enum dijkstra_net_type net_type,
if (net_meta) { if (net_meta) {
net_meta->type = net_type; net_meta->type = net_type;
net_meta->name = strdup(name); net_meta->name = strdup(name);
net_meta->access = access; if (access)
net_meta->access = strdup(access);
else
net_meta->access = NULL;
} }
return net_meta; return net_meta;