Edje pick: Fixed lockwork suspected leaks.
authorTom Hacohen <tom@stosb.com>
Mon, 18 Feb 2013 11:59:15 +0000 (11:59 +0000)
committerTom Hacohen <tom@stosb.com>
Mon, 18 Feb 2013 11:59:29 +0000 (11:59 +0000)
The problem is that apparently size can be 0 but some data can still
be returned.

src/bin/edje/edje_pick.c

index 05c114e..ea8a199 100644 (file)
@@ -713,6 +713,8 @@ _edje_pick_images_add(Edje_File *edf, Edje_File *o)
                        EINA_LOG_ERR("Image entry <%s> was not found in <%s> file.\n", buf , context.current_file->name);
                        status = EDJE_PICK_IMAGE_NOT_FOUND;
                     }
+                  /* Should that really be freed? Or is some other handling needed? */
+                  free(data);
                }
           }
 
@@ -812,6 +814,8 @@ _edje_pick_sounds_add(Edje_File *edf)
                   EINA_LOG_ERR("Sample <%s> was not found in <%s> file.\n",
                          sample->name, context.current_file->name);
                   status = EDJE_PICK_SAMPLE_NOT_FOUND;
+                  /* Should that really be freed? Or is some other handling needed? */
+                  free(data);
                }
           }
 
@@ -905,6 +909,11 @@ _edje_pick_scripts_add(Edje_File *edf, int id, int new_id)
                        buf, s->data, s->size));
         context.current_file->scriptlist = eina_list_append(context.current_file->scriptlist, s);
      }
+   else
+     {
+        /* Should that really be freed? Or is some other handling needed? */
+        free(data);
+     }
 
    return EDJE_PICK_NO_ERROR;
 }
@@ -933,6 +942,11 @@ _edje_pick_lua_scripts_add(Edje_File *edf, int id, int new_id)
                        buf, s->data, s->size));
         context.current_file->luascriptlist = eina_list_append(context.current_file->luascriptlist, s);
      }
+   else
+     {
+        /* Should that really be freed? Or is some other handling needed? */
+        free(data);
+     }
 
    return EDJE_PICK_NO_ERROR;
 }