From: Jérémie Galarneau Date: Tue, 19 Jan 2016 18:24:12 +0000 (-0500) Subject: Clean-up bt_put() implementation X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=b703b34e4cc4af21278e5eec8f01e5c40687a10b Clean-up bt_put() implementation Signed-off-by: Jérémie Galarneau --- 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); }