Enlightenment CVS committal

Author  : urandom
Project : e17
Module  : proto

Dir     : e17/proto/edje_viewer/src/bin


Modified Files:
        conf.c edje_etk.c edje_viewer.h etk_gui.c 


Log Message:
vagrind session

===================================================================
RCS file: /cvs/e/e17/proto/edje_viewer/src/bin/conf.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- conf.c      3 Jul 2006 01:16:09 -0000       1.1
+++ conf.c      8 Jul 2006 03:24:51 -0000       1.2
@@ -46,25 +46,26 @@
    snprintf(key, key_length, "/recent/%i", number);
    val = ecore_config_string_get(key);
 
-   free(key);
+   FREE(key);
    return val;
 }
 
 void edje_viewer_config_recent_set(char *path)
 {
    int count, key_length, i;
-   char *key, *val, *cwd;
+   char *key, *val, *cwd, *new_path;
 
    if (!path) return;
    count = edje_viewer_config_count_get();
 
+   new_path = malloc(PATH_MAX);
    if (strcmp(path, "/")) {
-       cwd = malloc(1024);
-       getcwd(cwd, 1024);
+       cwd = malloc(PATH_MAX);
+       getcwd(cwd, PATH_MAX);
 
-       snprintf(path, 1024, "%s/%s", cwd, strdup(path));
+       snprintf(new_path, PATH_MAX, "%s/%s", cwd, path);
 
-       free(cwd);
+       FREE(cwd);
    }
 
    key_length = strlen("/recent/") + 4;
@@ -73,13 +74,14 @@
      {
        snprintf(key, key_length, "/recent/%i", i + 1);
        val = ecore_config_string_get(key);
-       if (!strcmp(path, val))
+       if (!strcmp(new_path, val))
          {
-            free(key);
-            if (val) free(val);
+            FREE(key);
+            FREE(new_path);
+            if (val) FREE(val);
             return;
          }
-       if (val) free(val);
+       if (val) FREE(val);
      }
    count++;
    i = count;
@@ -92,7 +94,8 @@
 
    edje_viewer_config_count_set(count);
    snprintf(key, key_length, "/recent/%i", i);
-   ecore_config_string_set(key, path);
+   ecore_config_string_set(key, new_path);
 
-   free(key);
+   FREE(key);
+   FREE(new_path);
 }
===================================================================
RCS file: /cvs/e/e17/proto/edje_viewer/src/bin/edje_etk.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- edje_etk.c  2 Jul 2006 21:15:03 -0000       1.5
+++ edje_etk.c  8 Jul 2006 03:24:51 -0000       1.6
@@ -606,7 +606,7 @@
        etk_tree_row_select(row);
      }
 
-   free(str);
+   FREE(str);
 }
 
 
@@ -654,5 +654,5 @@
      }
    edje_object_message_send(obj, EDJE_MESSAGE_NONE, 12345, NULL);
 
-   free(str);
+   FREE(str);
 }
===================================================================
RCS file: /cvs/e/e17/proto/edje_viewer/src/bin/edje_viewer.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- edje_viewer.h       2 Jul 2006 21:15:03 -0000       1.2
+++ edje_viewer.h       8 Jul 2006 03:24:51 -0000       1.3
@@ -33,6 +33,12 @@
 #include <alloca.h>
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
+#define FREE(ptr) do { if(ptr) { free(ptr); ptr = NULL; }} while (0);
+
 #include "edje_etk.h"
 #include "etk_gui.h"
 #include "conf.h"
===================================================================
RCS file: /cvs/e/e17/proto/edje_viewer/src/bin/etk_gui.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- etk_gui.c   2 Jul 2006 21:15:03 -0000       1.6
+++ etk_gui.c   8 Jul 2006 03:24:51 -0000       1.7
@@ -287,7 +287,7 @@
    if (cwd)
      etk_filechooser_widget_current_folder_set(
             ETK_FILECHOOSER_WIDGET(gui->fm_chooser), cwd);
-   free(cwd);
+   FREE(cwd);
    etk_dialog_pack_in_main_area(ETK_DIALOG(gui->fm_dialog), gui->fm_chooser,
           ETK_TRUE, ETK_TRUE, 0, ETK_FALSE);
 
@@ -318,8 +318,8 @@
    gui->path = strdup(dir);
    gui->path = strcat(gui->path, "/");
    gui->path = strcat(gui->path, file);
-   free((char *)dir);
-   free((char *)file);
+   FREE(dir);
+   FREE(file);
    list_entries(gui->path, ETK_TREE(gui->tree), ETK_TREE(gui->output),
         ETK_CANVAS(gui->canvas));
    etk_window_hide_on_delete(ETK_OBJECT(gui->fm_dialog), NULL);



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to