From 17f8dc7e25a91514aaca0d47e61055ad880d89ff Mon Sep 17 00:00:00 2001 From: Yousef Al Rawwash Date: Wed, 13 Nov 2024 15:50:23 -0500 Subject: [PATCH] Resolving resource leaks warnings [How] Ensuring all memory is freed [Why] To ensure code quality Jira ID: EDGEML-8980 --- driver/src/common/xaie_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/driver/src/common/xaie_helper.c b/driver/src/common/xaie_helper.c index 071d4e3b..876b6e10 100644 --- a/driver/src/common/xaie_helper.c +++ b/driver/src/common/xaie_helper.c @@ -1428,6 +1428,7 @@ u8* _XAie_TxnExportSerialized(XAie_DevInst *DevInst, u8 NumConsumers, (AllocatedBuffSize) * 2U, BuffSize); if(TxnPtr == NULL) { printf("Realloc Failed\n"); + free(blockwrite_buffer); return NULL; } AllocatedBuffSize *= 2U; @@ -1550,6 +1551,7 @@ u8* _XAie_TxnExportSerialized(XAie_DevInst *DevInst, u8 NumConsumers, (BW_Buff_AllocatedSize) * 2U, BW_Buff_Size) ); if(blockwrite_buffer == NULL) { printf("Realloc Failed\n"); + free(TxnPtr); return NULL; } BW_Buff_AllocatedSize *= 2U; @@ -2632,6 +2634,7 @@ AieRC XAie_AddCustomTxnOp(XAie_DevInst *DevInst, u8 OpNumber, void* Args, size_t if(TxnInst->NumCmds + 1U == TxnInst->MaxCmds) { RC = _XAie_ReallocCmdBuf(TxnInst); if (RC != XAIE_OK) { + free(tmpBuff); return RC; }