Skip to content

Commit

Permalink
Fix #1461, Move data lock to inside of if block
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Dec 31, 2024
1 parent d6e6107 commit fd06a33
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/sb/fsw/src/cfe_sb_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1458,17 +1458,18 @@ CFE_Status_t CFE_SB_ReleaseMessageBuffer(CFE_SB_Buffer_t *BufPtr)
return CFE_SB_BAD_ARGUMENT;
}

CFE_SB_LockSharedData(__func__, __LINE__);

Status = CFE_SB_ZeroCopyBufferValidate(BufPtr, &BufDscPtr);

if (Status == CFE_SUCCESS)
{
CFE_SB_LockSharedData(__func__, __LINE__);

/* Clear the ownership app ID and decrement use count (may also free) */
BufDscPtr->AppId = CFE_ES_APPID_UNDEFINED;
CFE_SB_DecrBufUseCnt(BufDscPtr);
}

CFE_SB_UnlockSharedData(__func__, __LINE__);
CFE_SB_UnlockSharedData(__func__, __LINE__);
}

return Status;
}
Expand Down

0 comments on commit fd06a33

Please sign in to comment.