Skip to content

Commit 3fed3b1

Browse files
author
Nikolai Morin
committed
Add check in rcl_remap_name instead
Signed-off-by: Nikolai Morin <[email protected]>
1 parent 622068b commit 3fed3b1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

rcl/src/rcl/remap.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ rcl_remap_first_match(
142142
}
143143
continue;
144144
}
145-
if (NULL != name) {
146-
matched = (0 == strcmp(expanded_match, name));
147-
}
145+
matched = (0 == strcmp(expanded_match, name));
148146
allocator.deallocate(expanded_match, allocator.state);
149147
} else {
150148
// nodename and namespace replacement apply if the type and node name prefix checks passed
@@ -174,6 +172,9 @@ rcl_remap_name(
174172
{
175173
RCL_CHECK_ARGUMENT_FOR_NULL(node_name, RCL_RET_INVALID_ARGUMENT);
176174
RCL_CHECK_ARGUMENT_FOR_NULL(output_name, RCL_RET_INVALID_ARGUMENT);
175+
if (type_bitmask & (RCL_TOPIC_REMAP | RCL_SERVICE_REMAP)) {
176+
RCL_CHECK_ARGUMENT_FOR_NULL(name, RCL_RET_INVALID_ARGUMENT);
177+
}
177178
if (NULL != local_arguments && NULL == local_arguments->impl) {
178179
local_arguments = NULL;
179180
}

0 commit comments

Comments
 (0)