Skip to content

Commit

Permalink
Fix MISRA rule 22-1. (#1765)
Browse files Browse the repository at this point in the history
* Fix MISRA rule 22-1.

* update CI config with MISRA rule 22-1.

---------

Co-authored-by: eboasson <[email protected]>
  • Loading branch information
Splinter1984 and eboasson authored Jul 24, 2023
1 parent 8d120b9 commit b0eb340
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/codeql/resolved-misra-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ queries:
- uses: ./codeql-coding-standards/c/misra/src/rules/RULE-22-8/ErrnoSetToZeroPriorToCall.ql
- uses: ./codeql-coding-standards/c/misra/src/rules/RULE-8-3/DeclarationsOfAFunctionSameNameAndType.ql #[1/2]
# - uses: ./codeql-coding-standards/c/misra/src/rules/RULE-8-3/DeclarationsOfAnObjectSameNameAndType.ql #[2/2]
- uses: ./codeql-coding-standards/c/misra/src/rules/RULE-22-1/CloseFileHandleWhenNoLongerNeededMisra.ql
- uses: ./codeql-coding-standards/c/misra/src/rules/RULE-22-1/FreeMemoryWhenNoLongerNeededMisra.ql
# - uses: ./codeql-coding-standards/c/misra/src/rules/RULE-11-1/ConversionBetweenFunctionPointerAndOtherType.ql
1 change: 1 addition & 0 deletions src/ddsrt/src/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ ddsrt_gethostbyname(const char *name, int af, ddsrt_hostent_t **hentp)
memcpy(&hent->addrs[addrno], res->ai_addr, res->ai_addrlen);
}
} else {
freeaddrinfo(res);
return DDS_RETCODE_OUT_OF_RESOURCES;
}

Expand Down
1 change: 1 addition & 0 deletions src/ddsrt/src/threads/posix/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ dds_return_t ddsrt_thread_cleanup_push (void (*routine) (void * p), void *arg)
tail->arg = arg;
if ((err = pthread_setspecific(thread_cleanup_key, tail)) != 0) {
assert(err != EINVAL);
ddsrt_free(tail);
return DDS_RETCODE_OUT_OF_RESOURCES;
}
return DDS_RETCODE_OK;
Expand Down

0 comments on commit b0eb340

Please sign in to comment.