diff --git a/driver/src/common/xaie_helper.c b/driver/src/common/xaie_helper.c index c8432abf..a711c7d1 100644 --- a/driver/src/common/xaie_helper.c +++ b/driver/src/common/xaie_helper.c @@ -1440,6 +1440,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; @@ -1562,6 +1563,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; @@ -2644,6 +2646,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; }