From e610047ef3ca52a69f2362702f6c2ff0f0b6a2a3 Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Wed, 20 Nov 2013 13:20:03 +0100 Subject: [PATCH] efreet: store volatile value locally before return --- src/lib/efreet/efreet_desktop.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/efreet/efreet_desktop.c b/src/lib/efreet/efreet_desktop.c index 35e20e0..9c4c4e7 100644 --- a/src/lib/efreet/efreet_desktop.c +++ b/src/lib/efreet/efreet_desktop.c @@ -174,11 +174,14 @@ efreet_desktop_get(const char *file) EAPI int efreet_desktop_ref(Efreet_Desktop *desktop) { + int ret; + EINA_SAFETY_ON_NULL_RETURN_VAL(desktop, 0); eina_lock_take(&_lock); desktop->ref++; + ret = desktop->ref; eina_lock_release(&_lock); - return desktop->ref; + return ret; } EAPI Efreet_Desktop * -- 2.7.4