File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,8 +167,24 @@ struct pouch_gateway_downlink_context *pouch_gateway_downlink_start(struct bt_co
167167 }
168168
169169 node -> downlink_ctx = pouch_gateway_downlink_open (downlink_data_available , conn );
170+ if (node -> downlink_ctx == NULL )
171+ {
172+ LOG_ERR ("Failed to open downlink" );
173+ free (node -> downlink_scratch );
174+ node -> downlink_scratch = NULL ;
175+ return NULL ;
176+ }
170177 node -> packetizer =
171178 pouch_gatt_packetizer_start_callback (downlink_packet_fill_cb , node -> downlink_ctx );
179+ if (node -> packetizer == NULL )
180+ {
181+ LOG_ERR ("Failed to start packetizer" );
182+ pouch_gateway_downlink_close (node -> downlink_ctx );
183+ node -> downlink_ctx = NULL ;
184+ free (node -> downlink_scratch );
185+ node -> downlink_scratch = NULL ;
186+ return NULL ;
187+ }
172188
173189 return node -> downlink_ctx ;
174190}
You can’t perform that action at this time.
0 commit comments