devilhorns pushed a commit to branch master.

commit d0c24254cc8736c455aa5e2b6c84afe09c00324c
Author: Chris Michael <[email protected]>
Date:   Thu Aug 15 07:30:45 2013 +0100

    An Imf module can fail to create a context so we should check the
    return of module->create for valid context before trying to call
    functions or use it.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_imf/ecore_imf_module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/ecore_imf/ecore_imf_module.c 
b/src/lib/ecore_imf/ecore_imf_module.c
index 296f6bf..d16ad6e 100644
--- a/src/lib/ecore_imf/ecore_imf_module.c
+++ b/src/lib/ecore_imf/ecore_imf_module.c
@@ -157,7 +157,7 @@ ecore_imf_module_context_create(const char *ctx_id)
    module = eina_hash_find(modules, ctx_id);
    if (module)
      {
-        ctx = module->create();
+        if (!(ctx = module->create())) return NULL;
         if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
           {
              ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,

-- 

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

Reply via email to