Skip to content
Commit 82c2d813 authored by Sumera Priyadarsini's avatar Sumera Priyadarsini Committed by Julia Lawall
Browse files

coccinelle: iterators: Add for_each_child.cocci script



While iterating over child nodes with the for_each functions, if
control is transferred from the middle of the loop, as in the case
of a break or return or goto, there is no decrement in the
reference counter thus ultimately resulting in a memory leak.

Add this script to detect potential memory leaks caused by
the absence of of_node_put() before break, goto, or, return
statements which transfer control outside the loop.

Signed-off-by: default avatarSumera Priyadarsini <sylphrenadin@gmail.com>
Signed-off-by: default avatarJulia Lawall <julia.lawall@inria.fr>
parent c5864560
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment