Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1185, Squash possible uninitialized variable false alarms #1241

Merged
merged 1 commit into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ int32 CFE_ES_AppCreate(CFE_ES_AppId_t *ApplicationIdPtr, const char *AppName, co
{
CFE_Status_t Status;
CFE_ES_AppRecord_t *AppRecPtr;
CFE_ResourceId_t PendingResourceId;
CFE_ResourceId_t PendingResourceId = CFE_RESOURCEID_UNDEFINED;

/*
* The AppName must not be NULL
Expand Down
2 changes: 1 addition & 1 deletion modules/sb/fsw/src/cfe_sb_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int32 CFE_SB_CreatePipe(CFE_SB_PipeId_t *PipeIdPtr, uint16 Depth, const char *Pi
osal_id_t SysQueueId;
int32 Status;
CFE_SB_PipeD_t * PipeDscPtr;
CFE_ResourceId_t PendingPipeId;
CFE_ResourceId_t PendingPipeId = CFE_RESOURCEID_UNDEFINED;
uint16 PendingEventId;
char FullName[(OS_MAX_API_NAME * 2)];

Expand Down
27 changes: 13 additions & 14 deletions modules/time/fsw/src/cfe_time_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,21 +736,20 @@ int32 CFE_TIME_UnregisterSynchCallback(CFE_TIME_SynchCallbackPtr_t CallbackFuncP
if (Status == CFE_SUCCESS)
{
Status = CFE_ES_AppID_ToIndex(AppId, &AppIndex);
}
if (Status != CFE_SUCCESS)
{
/* Called from an invalid context */
return Status;
}

if (AppIndex >= (sizeof(CFE_TIME_Global.SynchCallback) / sizeof(CFE_TIME_Global.SynchCallback[0])) ||
CFE_TIME_Global.SynchCallback[AppIndex].Ptr != CallbackFuncPtr)
{
Status = CFE_TIME_CALLBACK_NOT_REGISTERED;
}
else
{
CFE_TIME_Global.SynchCallback[AppIndex].Ptr = NULL;
if (Status == CFE_SUCCESS)
{

if (AppIndex >= (sizeof(CFE_TIME_Global.SynchCallback) / sizeof(CFE_TIME_Global.SynchCallback[0])) ||
CFE_TIME_Global.SynchCallback[AppIndex].Ptr != CallbackFuncPtr)
{
Status = CFE_TIME_CALLBACK_NOT_REGISTERED;
}
else
{
CFE_TIME_Global.SynchCallback[AppIndex].Ptr = NULL;
}
}
}

return Status;
Expand Down