Skip to content

Commit

Permalink
Merge pull request #1241 from skliper/fix1185-uninit_vars
Browse files Browse the repository at this point in the history
Fix #1185, Squash possible uninitialized variable false alarms
  • Loading branch information
astrogeco authored Mar 24, 2021
2 parents ee2b601 + f1bcbe5 commit d869a19
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
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

0 comments on commit d869a19

Please sign in to comment.