From 5a659fafd22de295f8a4fb276e343f0da870779f Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 19 Oct 2016 16:14:15 +0100 Subject: [PATCH] Eo: Fix reference leak when failing to resolve function. When resolving a function for an object the object would get reference, and then in some failure cases won't be freed. I suspect this is a regression following the reshuffling that was done in that function recently. Thanks to zmike for investigating and reporting this. Fixes T4740 @fix --- src/lib/eo/eo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index 8324b21..8ce82f3 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -513,7 +513,11 @@ err_func_src: ERR("in %s:%d: you called a pure virtual func '%s' (%d) of class '%s'.", file, line, func_name, cache->op, klass->desc->name); err: - if (is_obj) _eo_obj_pointer_done((Eo_Id)eo_id); + if (is_obj) + { + _efl_unref(obj); + _eo_obj_pointer_done((Eo_Id)eo_id); + } return EINA_FALSE; // yes - special "move out of hot path" code blobs with goto's for -- 2.7.4