From 14899616a374236c942d1e5115036e3a2bc07c60 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Mon, 26 Jul 2021 15:24:40 -0700 Subject: [PATCH] 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 --- doc/contribute/coding_guidelines/index.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/contribute/coding_guidelines/index.rst b/doc/contribute/coding_guidelines/index.rst index 2b465376067..53be4c860a7 100644 --- a/doc/contribute/coding_guidelines/index.rst +++ b/doc/contribute/coding_guidelines/index.rst @@ -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 `_ + * - 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 `_ * - Rule 22.3 - Required - The same file shall not be open for read and write access at the same time on different streams