Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/file


Modified Files:
        evas_module.c 


Log Message:


fix buf free and some extras...

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/file/evas_module.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- evas_module.c       15 Jan 2006 05:04:32 -0000      1.8
+++ evas_module.c       15 Jan 2006 10:04:39 -0000      1.9
@@ -212,12 +212,10 @@
    
    if (em->loaded) return 1;
 
-   snprintf(buf, sizeof(buf), "%s/%s/%s/module.so", 
-           em->path, em->name, MODULE_ARCH);
+   snprintf(buf, sizeof(buf), "%s/%s/%s/module.so", em->path, em->name, 
MODULE_ARCH);
    if (!evas_file_path_exists(buf))
      {
        printf("[evas module] error loading the module %s. It doesnt exists\n", 
buf);
-       free(buf);
        return 0;
      }
    
@@ -235,9 +233,8 @@
        if (em->api->version != EVAS_MODULE_API_VERSION)
          {
             printf("[evas module] error loading the modules %s. The version 
doesnt match\n", buf);
-            free(buf);
+            goto error_dl;
          }
-       
        em->func.open(em);
        em->loaded = 1;
        return 1;
@@ -245,13 +242,16 @@
    error_dl:   
      {
        char *err;
+       
        err = dlerror();
        printf("[evas module] error loading the module %s. %s\n", buf, err);
        dlclose(handle);
        em->handle = NULL;
-       free(buf);
-       return 0;
+       em->func.open = NULL;
+       em->func.close = NULL;
+       em->api = NULL;
      }
+   return 0;
 }
 
 void
@@ -263,8 +263,12 @@
      {
        em->func.close(em);
        dlclose(em->handle);
-       em->loaded = 0;
      }
+   em->handle = NULL;
+   em->func.open = NULL;
+   em->func.close = NULL;
+   em->api = NULL;
+   em->loaded = 0;
 }
 
 /* will dlclose all the modules loaded and free all the structs */




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to