Skip to content

Commit f8a1345

Browse files
committed
fix(tbl): close file descriptor after table load command
Fixes #2811: CFE_TBL_LoadCmd opens a file via TxnOpenTableLoadFile but never closes it — TxnFinish only releases the registry lock. Every load command leaks one OS file descriptor, eventually exhausting the OSAL file table.
1 parent 0896102 commit f8a1345

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎modules/tbl/fsw/src/cfe_tbl_task_cmds.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,12 @@ CFE_Status_t CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data)
449449
CFE_TBL_SetMetaDataFromFileHeader(&Txn, LoadFilename, &Header.Std);
450450
}
451451

452+
/* Done with the file now -- must always close it regardless of what happened above */
453+
if (OS_ObjectIdDefined(FileDescriptor))
454+
{
455+
OS_close(FileDescriptor);
456+
}
457+
452458
CFE_TBL_TxnFinish(&Txn);
453459

454460
if (Status == CFE_SUCCESS)

0 commit comments

Comments
 (0)