doc: coding_guideline: Add a MISRA-C mandatory rule to Zephyr

This guideline seems to be missed during the Zephyr's code guideline
creation. That is a good guideline that aims to address some problems
like double free or freeing not allocated memory.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2021-07-26 15:24:40 -07:00 committed by Carles Cufí
commit 14899616a3

View file

@ -761,6 +761,11 @@ severity and the equivlent rules from other standards for reference.
- All resources obtained dynamically by means of Standard Library functions shall be explicitly released
- N/A
- `Rule 22.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_22_01.c>`_
* - Rule 22.2
- Mandatory
- A block of memory shall only be freed if it was allocated by means of a Standard Library function
- N/A
- `Rule 22.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_22_02.c>`_
* - Rule 22.3
- Required
- The same file shall not be open for read and write access at the same time on different streams