match: make match_owner_ref_rule() consistent
Right now, this function only takes a reference if it created a new
match rule, or if it returned one. This is quite inconsistent with its
function name, and hard to follow. Furthermore, there is no reason to
do so.
There are two options:
* Always take a reference, just as the name suggests.
* Only take a reference when returning a pointer.
The second option would make the function a no-op, whenever a new match
is created. Hence, we opt for the first version.
Any other behavior is odd and hard to understand by any reader. If that
behavior is really needed, we should provide something else.
Note that the only user of match_onwer_ref_rule() without an output
argument is BecomeMonitor(). However, this function is completely fine
with incrementing the ref-count for each entry it adds. There is no
reliance on the previous behavior.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Please register or sign in to comment