From b703b34e4cc4af21278e5eec8f01e5c40687a10b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 19 Jan 2016 13:24:12 -0500 Subject: [PATCH] Clean-up bt_put() implementation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- lib/ref.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ref.c b/lib/ref.c index 97460e93..ac058013 100644 --- a/lib/ref.c +++ b/lib/ref.c @@ -43,11 +43,13 @@ end: return obj; } -void bt_put(void *obj) +void bt_put(void *ptr) { - if (obj) { - struct bt_object *base = obj; + struct bt_object *obj = ptr; - bt_ref_put(&base->ref_count); + if (!obj) { + return; } + + bt_ref_put(&obj->ref_count); } -- 2.34.1