File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
test/unit-test/FreeRTOS_ND Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 592
592
MACAddress_t xMultiCastMacAddress ;
593
593
NetworkBufferDescriptor_t * pxDescriptor = pxNetworkBuffer ;
594
594
NetworkBufferDescriptor_t * pxNewDescriptor = NULL ;
595
+ BaseType_t xReleased = pdFALSE ;
595
596
596
597
if ( ( pxEndPoint != NULL ) && ( pxEndPoint -> bits .bIPv6 != pdFALSE_UNSIGNED ) )
597
598
{
675
676
676
677
/* This function will fill in the eth addresses and send the packet */
677
678
vReturnEthernetFrame ( pxDescriptor , pdTRUE );
679
+ xReleased = pdTRUE ;
678
680
}
679
681
}
682
+
683
+ if ( ( pxDescriptor != NULL ) && ( xReleased == pdFALSE ) )
684
+ {
685
+ vReleaseNetworkBufferAndDescriptor ( pxDescriptor );
686
+ }
680
687
}
681
688
/*-----------------------------------------------------------*/
682
689
Original file line number Diff line number Diff line change @@ -690,6 +690,7 @@ void test_vNDAgeCache_NSNullEP( void )
690
690
xNDCache [ xUseEntry ].pxEndPoint = NULL ;
691
691
692
692
pxGetNetworkBufferWithDescriptor_ExpectAnyArgsAndReturn ( & xNetworkBuffer );
693
+ vReleaseNetworkBufferAndDescriptor_Expect ( & xNetworkBuffer );
693
694
694
695
vNDAgeCache ();
695
696
@@ -814,6 +815,8 @@ void test_vNDSendNeighbourSolicitation_NULL_EP( void )
814
815
815
816
xNetworkBuffer .pxEndPoint = NULL ;
816
817
818
+ vReleaseNetworkBufferAndDescriptor_Expect ( & xNetworkBuffer );
819
+
817
820
vNDSendNeighbourSolicitation ( & xNetworkBuffer , & xIPAddress );
818
821
}
819
822
@@ -830,6 +833,7 @@ void test_vNDSendNeighbourSolicitation_bIPv6_NotSet( void )
830
833
xEndPoint .bits .bIPv6 = pdFALSE ;
831
834
xNetworkBuffer .pxEndPoint = & xEndPoint ;
832
835
836
+ vReleaseNetworkBufferAndDescriptor_Expect ( & xNetworkBuffer );
833
837
834
838
vNDSendNeighbourSolicitation ( & xNetworkBuffer , & xIPAddress );
835
839
}
You can’t perform that action at this time.
0 commit comments