File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -648,21 +648,23 @@ static tx_frame_t* tx_spool_v0(canard_t* const self,
648648 size_t offset = 0U ;
649649 while (offset < size_total ) {
650650 tx_frame_t * const item = tx_frame_new (self , smaller ((size_total - offset ) + 1U , CANARD_MTU_CAN_CLASSIC ));
651- if (NULL == head ) {
652- head = item ;
653- } else {
654- tail -> next = item ;
655- }
656- tail = item ;
657651 // On OOM, deallocate the entire chain and quit.
658- if (NULL == tail ) {
652+ if (NULL == item ) {
659653 while (head != NULL ) {
660654 tx_frame_t * const next = head -> next ;
661655 canard_refcount_dec (self , tx_frame_view (head ));
662656 head = next ;
663657 }
664658 break ;
665659 }
660+ // Append the new item.
661+ if (NULL == head ) {
662+ head = item ;
663+ } else {
664+ CANARD_ASSERT (NULL != tail );
665+ tail -> next = item ;
666+ }
667+ tail = item ;
666668 // Populate the frame contents.
667669 const size_t progress = smaller (size_total - offset , canard_dlc_to_len [tail -> dlc ] - 1U );
668670 bytes_chain_read (& reader , progress , tail -> data );
You can’t perform that action at this time.
0 commit comments