1414
1515#include "rmw/topic_endpoint_info.h"
1616
17+ #include "rcutils/macros.h"
1718#include "rcutils/strdup.h"
1819#include "rmw/error_handling.h"
1920#include "rmw/types.h"
@@ -71,6 +72,8 @@ rmw_topic_endpoint_info_fini(
7172 rmw_topic_endpoint_info_t * topic_endpoint_info ,
7273 rcutils_allocator_t * allocator )
7374{
75+ RCUTILS_CAN_RETURN_WITH_ERROR_OF (RMW_RET_INVALID_ARGUMENT );
76+
7477 if (!topic_endpoint_info ) {
7578 RMW_SET_ERROR_MSG ("topic_endpoint_info is null" );
7679 return RMW_RET_INVALID_ARGUMENT ;
@@ -105,6 +108,9 @@ _rmw_topic_endpoint_info_copy_str(
105108 const char * str ,
106109 rcutils_allocator_t * allocator )
107110{
111+ RCUTILS_CAN_RETURN_WITH_ERROR_OF (RMW_RET_INVALID_ARGUMENT );
112+ RCUTILS_CAN_RETURN_WITH_ERROR_OF (RMW_RET_BAD_ALLOC );
113+
108114 if (!str ) {
109115 RMW_SET_ERROR_MSG ("str is null" );
110116 return RMW_RET_INVALID_ARGUMENT ;
@@ -134,6 +140,8 @@ rmw_topic_endpoint_info_set_topic_type(
134140 const char * topic_type ,
135141 rcutils_allocator_t * allocator )
136142{
143+ RCUTILS_CAN_RETURN_WITH_ERROR_OF (RMW_RET_INVALID_ARGUMENT );
144+
137145 if (!topic_endpoint_info ) {
138146 RMW_SET_ERROR_MSG ("topic_endpoint_info is null" );
139147 return RMW_RET_INVALID_ARGUMENT ;
@@ -147,6 +155,8 @@ rmw_topic_endpoint_info_set_node_name(
147155 const char * node_name ,
148156 rcutils_allocator_t * allocator )
149157{
158+ RCUTILS_CAN_RETURN_WITH_ERROR_OF (RMW_RET_INVALID_ARGUMENT );
159+
150160 if (!topic_endpoint_info ) {
151161 RMW_SET_ERROR_MSG ("topic_endpoint_info is null" );
152162 return RMW_RET_INVALID_ARGUMENT ;
@@ -160,6 +170,8 @@ rmw_topic_endpoint_info_set_node_namespace(
160170 const char * node_namespace ,
161171 rcutils_allocator_t * allocator )
162172{
173+ RCUTILS_CAN_RETURN_WITH_ERROR_OF (RMW_RET_INVALID_ARGUMENT );
174+
163175 if (!topic_endpoint_info ) {
164176 RMW_SET_ERROR_MSG ("topic_endpoint_info is null" );
165177 return RMW_RET_INVALID_ARGUMENT ;
@@ -175,6 +187,8 @@ rmw_topic_endpoint_info_set_endpoint_type(
175187 rmw_topic_endpoint_info_t * topic_endpoint_info ,
176188 rmw_endpoint_type_t type )
177189{
190+ RCUTILS_CAN_RETURN_WITH_ERROR_OF (RMW_RET_INVALID_ARGUMENT );
191+
178192 if (!topic_endpoint_info ) {
179193 RMW_SET_ERROR_MSG ("topic_endpoint_info is null" );
180194 return RMW_RET_INVALID_ARGUMENT ;
@@ -191,6 +205,8 @@ rmw_topic_endpoint_info_set_gid(
191205 const uint8_t gid [],
192206 size_t size )
193207{
208+ RCUTILS_CAN_RETURN_WITH_ERROR_OF (RMW_RET_INVALID_ARGUMENT );
209+
194210 if (!topic_endpoint_info ) {
195211 RMW_SET_ERROR_MSG ("topic_endpoint_info is null" );
196212 return RMW_RET_INVALID_ARGUMENT ;
@@ -209,6 +225,8 @@ rmw_topic_endpoint_info_set_qos_profile(
209225 rmw_topic_endpoint_info_t * topic_endpoint_info ,
210226 const rmw_qos_profile_t * qos_profile )
211227{
228+ RCUTILS_CAN_RETURN_WITH_ERROR_OF (RMW_RET_INVALID_ARGUMENT );
229+
212230 if (!topic_endpoint_info ) {
213231 RMW_SET_ERROR_MSG ("topic_endpoint_info is null" );
214232 return RMW_RET_INVALID_ARGUMENT ;
0 commit comments