Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
fbp-generator: check if exported names were alloced
Browse files Browse the repository at this point in the history
Otherwise it may be unable to find port when
making connections.

Signed-off-by: Bruno Dilly <bruno.dilly@intel.com>
  • Loading branch information
bdilly committed Sep 14, 2015
1 parent f2ee2d0 commit f5973d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bin/sol-fbp-generator/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ add_fbp_type_to_type_store(struct type_store *parent_store, struct fbp_data *dat
SOL_NULL_CHECK_GOTO(p, fail_in_ports);

p->name = strndupa(e->exported_name.data, e->exported_name.len);
SOL_NULL_CHECK_GOTO(p->name, fail_in_ports);

SOL_VECTOR_FOREACH_IDX (&desc->in_ports, port, j) {
if (sol_str_slice_str_eq(e->port, port->name)) {
Expand Down Expand Up @@ -1157,6 +1158,7 @@ add_fbp_type_to_type_store(struct type_store *parent_store, struct fbp_data *dat
SOL_NULL_CHECK_GOTO(p, fail_out_ports);

p->name = strndupa(e->exported_name.data, e->exported_name.len);
SOL_NULL_CHECK_GOTO(p->name, fail_out_ports);

SOL_VECTOR_FOREACH_IDX (&desc->out_ports, port, j) {
if (sol_str_slice_str_eq(e->port, port->name)) {
Expand Down

0 comments on commit f5973d5

Please sign in to comment.