summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-01-22 11:08:47 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-01-22 11:13:11 +0900
commitf873373e587b009169679d970e6712d07c3521b9 (patch)
tree082c53fb5fde2252cee05463de2f43e155202b4a
parentc3403450ef916c4b971402e772372c9501924ad9 (diff)
elm: Removed unnecessary null check for free.
-rw-r--r--src/lib/elc_fileselector_entry.c4
-rw-r--r--src/lib/elm_access.c6
-rw-r--r--src/lib/elm_cnp.c26
-rw-r--r--src/lib/elm_config.c2
-rw-r--r--src/lib/elm_dbus_menu.c3
-rw-r--r--src/lib/elm_entry.c29
-rw-r--r--src/lib/elm_flip.c3
-rw-r--r--src/lib/elm_image.c6
-rw-r--r--src/lib/elm_main.c8
-rw-r--r--src/lib/elm_map.c14
-rw-r--r--src/lib/elm_photocam.c7
-rw-r--r--src/lib/elm_prefs_data.c6
-rw-r--r--src/lib/elm_store.c4
-rw-r--r--src/lib/elm_transit.c8
-rw-r--r--src/lib/elm_widget.c3
-rw-r--r--src/lib/elm_win.c4
16 files changed, 53 insertions, 80 deletions
diff --git a/src/lib/elc_fileselector_entry.c b/src/lib/elc_fileselector_entry.c
index 05e9a68cc..0431189dc 100644
--- a/src/lib/elc_fileselector_entry.c
+++ b/src/lib/elc_fileselector_entry.c
@@ -397,7 +397,7 @@ _elm_fileselector_entry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
397{ 397{
398 Elm_Fileselector_Entry_Smart_Data *sd = _pd; 398 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
399 399
400 if (sd->path) free(sd->path); 400 free(sd->path);
401 401
402 eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); 402 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
403} 403}
@@ -569,7 +569,7 @@ _path_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
569 const char **ret = va_arg(*list, const char **); 569 const char **ret = va_arg(*list, const char **);
570 Elm_Fileselector_Entry_Smart_Data *sd = _pd; 570 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
571 571
572 if (sd->path) free(sd->path); 572 free(sd->path);
573 sd->path = elm_entry_markup_to_utf8(elm_object_text_get(sd->entry)); 573 sd->path = elm_entry_markup_to_utf8(elm_object_text_get(sd->entry));
574 *ret = sd->path; 574 *ret = sd->path;
575} 575}
diff --git a/src/lib/elm_access.c b/src/lib/elm_access.c
index 3fe5a1c74..b9dd1de4a 100644
--- a/src/lib/elm_access.c
+++ b/src/lib/elm_access.c
@@ -68,7 +68,7 @@ _access_action_callback_call(Evas_Object *obj,
68 if (a && (a->fn[type].cb)) 68 if (a && (a->fn[type].cb))
69 ret = a->fn[type].cb(a->fn[type].user_data, obj, action_info); 69 ret = a->fn[type].cb(a->fn[type].user_data, obj, action_info);
70 70
71 if (ai) free(ai); 71 free(ai);
72 72
73 return ret; 73 return ret;
74} 74}
@@ -738,7 +738,7 @@ _elm_access_read(Elm_Access_Info *ac, int type, const Evas_Object *obj)
738 } 738 }
739 } 739 }
740 } 740 }
741 if (txt) free(txt); 741 free(txt);
742} 742}
743 743
744EAPI void 744EAPI void
@@ -1118,7 +1118,7 @@ _elm_access_object_unregister(Evas_Object *obj, Evas_Object *hoverobj)
1118 Action_Info *a; 1118 Action_Info *a;
1119 a = evas_object_data_get(obj, "_elm_access_action_info"); 1119 a = evas_object_data_get(obj, "_elm_access_action_info");
1120 evas_object_data_del(obj, "_elm_access_action_info"); 1120 evas_object_data_del(obj, "_elm_access_action_info");
1121 if (a) free(a); 1121 free(a);
1122} 1122}
1123 1123
1124EAPI void 1124EAPI void
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index daca9fb83..5efcd05e2 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -936,7 +936,7 @@ _x11_notify_handler_uri(X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *
936 cnp_debug("Couldn't find a file\n"); 936 cnp_debug("Couldn't find a file\n");
937 return 0; 937 return 0;
938 } 938 }
939 if (savedtypes.imgfile) free(savedtypes.imgfile); 939 free(savedtypes.imgfile);
940 if (savedtypes.textreq) 940 if (savedtypes.textreq)
941 { 941 {
942 savedtypes.textreq = 0; 942 savedtypes.textreq = 0;
@@ -1270,7 +1270,7 @@ _x11_dnd_enter(void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev)
1270 1270
1271 cnp_debug("Types\n"); 1271 cnp_debug("Types\n");
1272 savedtypes.ntypes = enter->num_types; 1272 savedtypes.ntypes = enter->num_types;
1273 if (savedtypes.types) free(savedtypes.types); 1273 free(savedtypes.types);
1274 savedtypes.types = malloc(sizeof(char *) * enter->num_types); 1274 savedtypes.types = malloc(sizeof(char *) * enter->num_types);
1275 if (!savedtypes.types) return EINA_FALSE; 1275 if (!savedtypes.types) return EINA_FALSE;
1276 1276
@@ -1284,8 +1284,7 @@ _x11_dnd_enter(void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev)
1284 /* Request it, so we know what it is */ 1284 /* Request it, so we know what it is */
1285 cnp_debug("Sending uri request\n"); 1285 cnp_debug("Sending uri request\n");
1286 savedtypes.textreq = 1; 1286 savedtypes.textreq = 1;
1287 if (savedtypes.imgfile) free(savedtypes.imgfile); 1287 ELM_SAFE_FREE(savedtypes.imgfile, free);
1288 savedtypes.imgfile = NULL;
1289 ecore_x_selection_xdnd_request(enter->win, text_uri); 1288 ecore_x_selection_xdnd_request(enter->win, text_uri);
1290 } 1289 }
1291 } 1290 }
@@ -2303,7 +2302,7 @@ _wl_elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Form
2303 2302
2304 ecore_wl_dnd_selection_set(ecore_wl_input_get(), types); 2303 ecore_wl_dnd_selection_set(ecore_wl_input_get(), types);
2305 2304
2306 if (sel->selbuf) free(sel->selbuf); 2305 free(sel->selbuf);
2307 sel->buflen = buflen; 2306 sel->buflen = buflen;
2308 sel->selbuf = strdup((char*)selbuf); 2307 sel->selbuf = strdup((char*)selbuf);
2309 2308
@@ -2658,8 +2657,7 @@ _wl_elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
2658 { 2657 {
2659 drops = eina_list_remove(drops, dropable); 2658 drops = eina_list_remove(drops, dropable);
2660 eo_do(obj, eo_base_data_del("__elm_dropable")); 2659 eo_do(obj, eo_base_data_del("__elm_dropable"));
2661 free(dropable); 2660 ELM_SAFE_FREE(dropable, free);
2662 dropable = NULL;
2663 evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, 2661 evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
2664 _all_drop_targets_cbs_del); 2662 _all_drop_targets_cbs_del);
2665 } 2663 }
@@ -2708,7 +2706,7 @@ _wl_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format EINA_UNUSED, const ch
2708 ecore_wl_dnd_drag_types_set(ecore_wl_input_get(), types); 2706 ecore_wl_dnd_drag_types_set(ecore_wl_input_get(), types);
2709 2707
2710 /* set the drag data used when a drop occurs */ 2708 /* set the drag data used when a drop occurs */
2711 if (wl_cnp_selection.selbuf) free(wl_cnp_selection.selbuf); 2709 free(wl_cnp_selection.selbuf);
2712 wl_cnp_selection.selbuf = strdup((char*)data); 2710 wl_cnp_selection.selbuf = strdup((char*)data);
2713 wl_cnp_selection.buflen = strlen(wl_cnp_selection.selbuf); 2711 wl_cnp_selection.buflen = strlen(wl_cnp_selection.selbuf);
2714 2712
@@ -2801,7 +2799,7 @@ _wl_dnd_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
2801 if ((!ev->num_types) || (!ev->types)) return ECORE_CALLBACK_PASS_ON; 2799 if ((!ev->num_types) || (!ev->types)) return ECORE_CALLBACK_PASS_ON;
2802 2800
2803 savedtypes.ntypes = ev->num_types; 2801 savedtypes.ntypes = ev->num_types;
2804 if (savedtypes.types) free(savedtypes.types); 2802 free(savedtypes.types);
2805 savedtypes.types = malloc(sizeof(char *) * ev->num_types); 2803 savedtypes.types = malloc(sizeof(char *) * ev->num_types);
2806 if (!savedtypes.types) return EINA_FALSE; 2804 if (!savedtypes.types) return EINA_FALSE;
2807 2805
@@ -2811,8 +2809,7 @@ _wl_dnd_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
2811 if (savedtypes.types[i] == text_uri) 2809 if (savedtypes.types[i] == text_uri)
2812 { 2810 {
2813 savedtypes.textreq = 1; 2811 savedtypes.textreq = 1;
2814 if (savedtypes.imgfile) free(savedtypes.imgfile); 2812 ELM_SAFE_FREE(savedtypes.imgfile, free);
2815 savedtypes.imgfile = NULL;
2816 } 2813 }
2817 } 2814 }
2818 2815
@@ -3376,8 +3373,7 @@ _local_elm_cnp_selection_set(Evas_Object *obj EINA_UNUSED,
3376 const void *selbuf, size_t buflen) 3373 const void *selbuf, size_t buflen)
3377{ 3374{
3378 _local_elm_cnp_init(); 3375 _local_elm_cnp_init();
3379 if (_local_selinfo[selection].sel.buf) 3376 free(_local_selinfo[selection].sel.buf);
3380 free(_local_selinfo[selection].sel.buf);
3381 _local_selinfo[selection].format = format; 3377 _local_selinfo[selection].format = format;
3382 _local_selinfo[selection].sel.buf = malloc(buflen + 1); 3378 _local_selinfo[selection].sel.buf = malloc(buflen + 1);
3383 if (_local_selinfo[selection].sel.buf) 3379 if (_local_selinfo[selection].sel.buf)
@@ -3407,9 +3403,7 @@ _local_elm_object_cnp_selection_clear(Evas_Object *obj EINA_UNUSED,
3407 Elm_Sel_Type selection) 3403 Elm_Sel_Type selection)
3408{ 3404{
3409 _local_elm_cnp_init(); 3405 _local_elm_cnp_init();
3410 if (_local_selinfo[selection].sel.buf) 3406 ELM_SAFE_FREE(_local_selinfo[selection].sel.buf, free);
3411 free(_local_selinfo[selection].sel.buf);
3412 _local_selinfo[selection].sel.buf = NULL;
3413 _local_selinfo[selection].sel.size = 0; 3407 _local_selinfo[selection].sel.size = 0;
3414 return EINA_TRUE; 3408 return EINA_TRUE;
3415} 3409}
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index 4cdc9b38c..286e2227c 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -213,7 +213,7 @@ _prop_change_delay_cb(void *data EINA_UNUSED)
213 s = ecore_x_window_prop_string_get(_config_win, _atom[ATOM_E_PROFILE]); 213 s = ecore_x_window_prop_string_get(_config_win, _atom[ATOM_E_PROFILE]);
214 if (s) 214 if (s)
215 { 215 {
216 if (_elm_profile) free(_elm_profile); 216 free(_elm_profile);
217 _elm_profile = s; 217 _elm_profile = s;
218 } 218 }
219 } 219 }
diff --git a/src/lib/elm_dbus_menu.c b/src/lib/elm_dbus_menu.c
index b70b132b3..7c151cc56 100644
--- a/src/lib/elm_dbus_menu.c
+++ b/src/lib/elm_dbus_menu.c
@@ -923,8 +923,7 @@ _elm_dbus_menu_unregister(Eo *obj)
923 ecore_idler_del(sd->dbus_menu->signal_idler); 923 ecore_idler_del(sd->dbus_menu->signal_idler);
924 924
925 eina_hash_free(sd->dbus_menu->elements); 925 eina_hash_free(sd->dbus_menu->elements);
926 free(sd->dbus_menu); 926 ELM_SAFE_FREE(sd->dbus_menu, free);
927 sd->dbus_menu = NULL;
928} 927}
929 928
930void 929void
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index 0ce8cf320..c34a31b71 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -121,8 +121,7 @@ _file_load(const char *file)
121 121
122 if (eina_file_map_faulted(f, tmp)) 122 if (eina_file_map_faulted(f, tmp))
123 { 123 {
124 free(text); 124 ELM_SAFE_FREE(text, free);
125 text = NULL;
126 } 125 }
127 126
128 on_error: 127 on_error:
@@ -347,7 +346,7 @@ _filter_free(Elm_Entry_Markup_Filter *tf)
347 { 346 {
348 Elm_Entry_Filter_Limit_Size *lim = tf->data; 347 Elm_Entry_Filter_Limit_Size *lim = tf->data;
349 348
350 if (lim) free(lim); 349 free(lim);
351 } 350 }
352 else if (tf->func == elm_entry_filter_accept_set) 351 else if (tf->func == elm_entry_filter_accept_set)
353 { 352 {
@@ -2566,19 +2565,16 @@ _chars_add_till_limit(Evas_Object *obj,
2566 unit_size = strlen(utfstr); 2565 unit_size = strlen(utfstr);
2567 else if (unit == LENGTH_UNIT_CHAR) 2566 else if (unit == LENGTH_UNIT_CHAR)
2568 unit_size = evas_string_char_len_get(utfstr); 2567 unit_size = evas_string_char_len_get(utfstr);
2569 free(utfstr); 2568 ELM_SAFE_FREE(utfstr, free);
2570 utfstr = NULL;
2571 } 2569 }
2572 free(markup); 2570 ELM_SAFE_FREE(markup, free);
2573 markup = NULL;
2574 } 2571 }
2575 if (can_add < unit_size) 2572 if (can_add < unit_size)
2576 { 2573 {
2577 if (!i) 2574 if (!i)
2578 { 2575 {
2579 evas_object_smart_callback_call(obj, SIG_MAX_LENGTH, NULL); 2576 evas_object_smart_callback_call(obj, SIG_MAX_LENGTH, NULL);
2580 free(*text); 2577 ELM_SAFE_FREE(*text, free);
2581 *text = NULL;
2582 return; 2578 return;
2583 } 2579 }
2584 can_add = 0; 2580 can_add = 0;
@@ -2750,8 +2746,7 @@ _elm_entry_smart_text_set(Eo *obj, void *_pd, va_list *list)
2750 if (sd->append_text_idler) 2746 if (sd->append_text_idler)
2751 { 2747 {
2752 ecore_idler_del(sd->append_text_idler); 2748 ecore_idler_del(sd->append_text_idler);
2753 free(sd->append_text_left); 2749 ELM_SAFE_FREE(sd->append_text_left, free);
2754 sd->append_text_left = NULL;
2755 sd->append_text_idler = NULL; 2750 sd->append_text_idler = NULL;
2756 } 2751 }
2757 2752
@@ -3410,8 +3405,7 @@ _elm_entry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
3410 if (sd->append_text_idler) 3405 if (sd->append_text_idler)
3411 { 3406 {
3412 ecore_idler_del(sd->append_text_idler); 3407 ecore_idler_del(sd->append_text_idler);
3413 free(sd->append_text_left); 3408 ELM_SAFE_FREE(sd->append_text_left, free);
3414 sd->append_text_left = NULL;
3415 sd->append_text_idler = NULL; 3409 sd->append_text_idler = NULL;
3416 } 3410 }
3417 ecore_timer_del(sd->longpress_timer); 3411 ecore_timer_del(sd->longpress_timer);
@@ -4700,8 +4694,7 @@ elm_entry_filter_limit_size(void *data,
4700 if ((len >= lim->max_char_count) && (newlen > 0)) 4694 if ((len >= lim->max_char_count) && (newlen > 0))
4701 { 4695 {
4702 evas_object_smart_callback_call(entry, SIG_MAX_LENGTH, NULL); 4696 evas_object_smart_callback_call(entry, SIG_MAX_LENGTH, NULL);
4703 free(*text); 4697 ELM_SAFE_FREE(*text, free);
4704 *text = NULL;
4705 free(current); 4698 free(current);
4706 free(utfstr); 4699 free(utfstr);
4707 return; 4700 return;
@@ -4717,8 +4710,7 @@ elm_entry_filter_limit_size(void *data,
4717 if ((len >= lim->max_byte_count) && (newlen > 0)) 4710 if ((len >= lim->max_byte_count) && (newlen > 0))
4718 { 4711 {
4719 evas_object_smart_callback_call(entry, SIG_MAX_LENGTH, NULL); 4712 evas_object_smart_callback_call(entry, SIG_MAX_LENGTH, NULL);
4720 free(*text); 4713 ELM_SAFE_FREE(*text, free);
4721 *text = NULL;
4722 free(current); 4714 free(current);
4723 free(utfstr); 4715 free(utfstr);
4724 return; 4716 return;
@@ -5507,8 +5499,7 @@ _input_panel_imdata_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5507 int len = va_arg(*list, int); 5499 int len = va_arg(*list, int);
5508 Elm_Entry_Smart_Data *sd = _pd; 5500 Elm_Entry_Smart_Data *sd = _pd;
5509 5501
5510 if (sd->input_panel_imdata) 5502 free(sd->input_panel_imdata);
5511 free(sd->input_panel_imdata);
5512 5503
5513 sd->input_panel_imdata = calloc(1, len); 5504 sd->input_panel_imdata = calloc(1, len);
5514 sd->input_panel_imdata_len = len; 5505 sd->input_panel_imdata_len = len;
diff --git a/src/lib/elm_flip.c b/src/lib/elm_flip.c
index f47442f00..f8556c844 100644
--- a/src/lib/elm_flip.c
+++ b/src/lib/elm_flip.c
@@ -679,8 +679,7 @@ _state_update(Evas_Object *obj)
679 sd->slices2 = calloc(sd->slices_w * sd->slices_h, sizeof(Slice *)); 679 sd->slices2 = calloc(sd->slices_w * sd->slices_h, sizeof(Slice *));
680 if (!sd->slices2) 680 if (!sd->slices2)
681 { 681 {
682 free(sd->slices); 682 ELM_SAFE_FREE(sd->slices, free);
683 sd->slices = NULL;
684 return 0; 683 return 0;
685 } 684 }
686 } 685 }
diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c
index cb0e27b10..7db194758 100644
--- a/src/lib/elm_image.c
+++ b/src/lib/elm_image.c
@@ -919,7 +919,7 @@ _elm_image_smart_download_done(void *data, Elm_Url *url EINA_UNUSED, Eina_Binbuf
919 size_t length; 919 size_t length;
920 Eina_Bool ret = EINA_FALSE; 920 Eina_Bool ret = EINA_FALSE;
921 921
922 if (sd->remote_data) free(sd->remote_data); 922 free(sd->remote_data);
923 length = eina_binbuf_length_get(download); 923 length = eina_binbuf_length_get(download);
924 sd->remote_data = eina_binbuf_string_steal(download); 924 sd->remote_data = eina_binbuf_string_steal(download);
925 f = eina_file_virtualize(_elm_url_get(url), 925 f = eina_file_virtualize(_elm_url_get(url),
@@ -1409,7 +1409,7 @@ _elm_image_smart_orient_set(Eo *obj, void *_pd, va_list *list)
1409 default: 1409 default:
1410 ERR("unknown orient %d", orient); 1410 ERR("unknown orient %d", orient);
1411 evas_object_image_data_set(sd->img, data); // give it back 1411 evas_object_image_data_set(sd->img, data); // give it back
1412 if (data2) free(data2); 1412 free(data2);
1413 1413
1414 return; 1414 return;
1415 } 1415 }
@@ -1425,7 +1425,7 @@ _elm_image_smart_orient_set(Eo *obj, void *_pd, va_list *list)
1425 } 1425 }
1426 to += hw; 1426 to += hw;
1427 } 1427 }
1428 if (data2) free(data2); 1428 free(data2);
1429 1429
1430 evas_object_image_data_set(sd->img, data); 1430 evas_object_image_data_set(sd->img, data);
1431 evas_object_image_data_update_add(sd->img, 0, 0, iw, ih); 1431 evas_object_image_data_update_add(sd->img, 0, 0, iw, ih);
diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c
index 81734e530..883bdc469 100644
--- a/src/lib/elm_main.c
+++ b/src/lib/elm_main.c
@@ -836,10 +836,7 @@ elm_quicklaunch_prepare(int argc,
836 strcat(p, exename); 836 strcat(p, exename);
837 strcat(p, LIBEXT); 837 strcat(p, LIBEXT);
838 if (access(exe2, R_OK | X_OK) != 0) 838 if (access(exe2, R_OK | X_OK) != 0)
839 { 839 ELM_SAFE_FREE(exe2, free);
840 free(exe2);
841 exe2 = NULL;
842 }
843 840
844 /* Try linking to executable first. Works with PIE files. */ 841 /* Try linking to executable first. Works with PIE files. */
845 qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL); 842 qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL);
@@ -944,8 +941,7 @@ elm_quicklaunch_fork(int argc,
944 941
945 if (quicklaunch_on) 942 if (quicklaunch_on)
946 { 943 {
947 if (_elm_appname) free(_elm_appname); 944 ELM_SAFE_FREE(_elm_appname, free);
948 _elm_appname = NULL;
949 if ((argv) && (argv[0])) 945 if ((argv) && (argv[0]))
950 _elm_appname = strdup(ecore_file_file_get(argv[0])); 946 _elm_appname = strdup(ecore_file_file_get(argv[0]));
951 947
diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c
index 378756638..eb579d120 100644
--- a/src/lib/elm_map.c
+++ b/src/lib/elm_map.c
@@ -216,7 +216,7 @@ _nominatim_url_cb(const Evas_Object *obj,
216 216
217 if (str) 217 if (str)
218 { 218 {
219 if (str[0]) free(str[0]); 219 free(str[0]);
220 free(str); 220 free(str);
221 } 221 }
222 } 222 }
@@ -709,7 +709,7 @@ _grid_item_create(Grid *g,
709 } 709 }
710 else eina_stringshare_replace(&gi->url, url); 710 else eina_stringshare_replace(&gi->url, url);
711 711
712 if (url) free(url); 712 free(url);
713 eina_matrixsparse_data_idx_set(g->grid, y, x, gi); 713 eina_matrixsparse_data_idx_set(g->grid, y, x, gi);
714 714
715 return gi; 715 return gi;
@@ -3130,7 +3130,7 @@ _name_request(const Evas_Object *obj,
3130 &(name->job), sd->ua) || !(name->job)) 3130 &(name->job), sd->ua) || !(name->job))
3131 { 3131 {
3132 ERR("Can't request Name from %s to %s", url, name->fname); 3132 ERR("Can't request Name from %s to %s", url, name->fname);
3133 if (name->address) free(name->address); 3133 free(name->address);
3134 free(name->fname); 3134 free(name->fname);
3135 free(name); 3135 free(name);
3136 free(fname); 3136 free(fname);
@@ -4797,10 +4797,10 @@ _route_add(Eo *obj, void *_pd, va_list *list)
4797 if (!url) 4797 if (!url)
4798 { 4798 {
4799 ERR("Route URL is NULL"); 4799 ERR("Route URL is NULL");
4800 if (type_name) free(type_name); 4800 free(type_name);
4801 return; 4801 return;
4802 } 4802 }
4803 if (type_name) free(type_name); 4803 free(type_name);
4804 4804
4805 route = ELM_NEW(Elm_Map_Route); 4805 route = ELM_NEW(Elm_Map_Route);
4806 route->wsd = sd; 4806 route->wsd = sd;
@@ -4939,8 +4939,8 @@ elm_map_name_del(Elm_Map_Name *name)
4939 EINA_SAFETY_ON_NULL_RETURN(name->wsd); 4939 EINA_SAFETY_ON_NULL_RETURN(name->wsd);
4940 ELM_MAP_CHECK((name->wsd)->obj); 4940 ELM_MAP_CHECK((name->wsd)->obj);
4941 4941
4942 if (name->job) ecore_file_download_abort(name->job); 4942 ecore_file_download_abort(name->job);
4943 if (name->address) free(name->address); 4943 free(name->address);
4944 if (name->fname) 4944 if (name->fname)
4945 { 4945 {
4946 ecore_file_remove(name->fname); 4946 ecore_file_remove(name->fname);
diff --git a/src/lib/elm_photocam.c b/src/lib/elm_photocam.c
index cdc1a8b02..2639d7228 100644
--- a/src/lib/elm_photocam.c
+++ b/src/lib/elm_photocam.c
@@ -513,8 +513,7 @@ _grid_clear(Evas_Object *obj,
513 } 513 }
514 } 514 }
515 515
516 free(g->grid); 516 ELM_SAFE_FREE(g->grid, free);
517 g->grid = NULL;
518 g->gw = 0; 517 g->gw = 0;
519 g->gh = 0; 518 g->gh = 0;
520} 519}
@@ -1404,7 +1403,7 @@ _elm_photocam_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1404 1403
1405 EINA_LIST_FREE(sd->grids, g) 1404 EINA_LIST_FREE(sd->grids, g)
1406 { 1405 {
1407 if (g->grid) free(g->grid); 1406 free(g->grid);
1408 free(g); 1407 free(g);
1409 } 1408 }
1410 eo_unref(sd->pan_obj); 1409 eo_unref(sd->pan_obj);
@@ -1556,7 +1555,7 @@ _elm_photocam_download_done(void *data, Elm_Url *url EINA_UNUSED, Eina_Binbuf *d
1556 size_t length; 1555 size_t length;
1557 Evas_Load_Error ret = EVAS_LOAD_ERROR_NONE; 1556 Evas_Load_Error ret = EVAS_LOAD_ERROR_NONE;
1558 1557
1559 if (sd->remote_data) free(sd->remote_data); 1558 free(sd->remote_data);
1560 length = eina_binbuf_length_get(download); 1559 length = eina_binbuf_length_get(download);
1561 sd->remote_data = eina_binbuf_string_steal(download); 1560 sd->remote_data = eina_binbuf_string_steal(download);
1562 f = eina_file_virtualize(_elm_url_get(url), 1561 f = eina_file_virtualize(_elm_url_get(url),
diff --git a/src/lib/elm_prefs_data.c b/src/lib/elm_prefs_data.c
index 6583c14be..88d490088 100644
--- a/src/lib/elm_prefs_data.c
+++ b/src/lib/elm_prefs_data.c
@@ -299,8 +299,7 @@ _eet_data_load(Elm_Prefs_Data *prefs_data,
299 default: 299 default:
300 ERR("bad item (type = %d) fetched from data file %s, skipping it", 300 ERR("bad item (type = %d) fetched from data file %s, skipping it",
301 it->type, prefs_data->data_file); 301 it->type, prefs_data->data_file);
302 free(item); 302 ELM_SAFE_FREE(item, free);
303 item = NULL;
304 skip = EINA_TRUE; 303 skip = EINA_TRUE;
305 break; 304 break;
306 } 305 }
@@ -311,8 +310,7 @@ _eet_data_load(Elm_Prefs_Data *prefs_data,
311 skip = EINA_TRUE; 310 skip = EINA_TRUE;
312 311
313 if (set_err) eina_value_flush(&(item->value)); 312 if (set_err) eina_value_flush(&(item->value));
314 free(item); 313 ELM_SAFE_FREE(item, free);
315 item = NULL;
316 } 314 }
317 315
318 if (!skip) eina_hash_set(map, it->name, item); 316 if (!skip) eina_hash_set(map, it->name, item);
diff --git a/src/lib/elm_store.c b/src/lib/elm_store.c
index c96049b74..fda2e0be9 100644
--- a/src/lib/elm_store.c
+++ b/src/lib/elm_store.c
@@ -399,7 +399,7 @@ _store_filesystem_list_do(void *data, Ecore_Thread *th EINA_UNUSED)
399 } 399 }
400 else 400 else
401 { 401 {
402 if (info->base.sort_id) free(info->base.sort_id); 402 free(info->base.sort_id);
403 free(info); 403 free(info);
404 } 404 }
405 if (ecore_thread_check(th)) break; 405 if (ecore_thread_check(th)) break;
@@ -469,7 +469,7 @@ _store_filesystem_list_update(void *data, Ecore_Thread *th EINA_UNUSED, void *ms
469 NULL/* func data */); 469 NULL/* func data */);
470 st->items = eina_inlist_append(st->items, (Eina_Inlist *)sti); 470 st->items = eina_inlist_append(st->items, (Eina_Inlist *)sti);
471done: 471done:
472 if (info->base.sort_id) free(info->base.sort_id); 472 free(info->base.sort_id);
473 free(info); 473 free(info);
474} 474}
475 475
diff --git a/src/lib/elm_transit.c b/src/lib/elm_transit.c
index cac364a65..d8a2d3e9d 100644
--- a/src/lib/elm_transit.c
+++ b/src/lib/elm_transit.c
@@ -118,10 +118,9 @@ _transit_obj_data_update(Elm_Transit *transit, Evas_Object *obj)
118 118
119 obj_data->freeze_events = evas_object_freeze_events_get(obj); 119 obj_data->freeze_events = evas_object_freeze_events_get(obj);
120 120
121 if ((!transit->state_keep) && (obj_data->state)) 121 if (!transit->state_keep)
122 { 122 {
123 free(obj_data->state); 123 ELM_SAFE_FREE(obj_data->state, free);
124 obj_data->state = NULL;
125 } 124 }
126 else 125 else
127 { 126 {
@@ -172,8 +171,7 @@ _transit_obj_remove_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *
172 Elm_Transit_Obj_Data *obj_data = evas_object_data_get(obj, _transit_key); 171 Elm_Transit_Obj_Data *obj_data = evas_object_data_get(obj, _transit_key);
173 if (obj_data) 172 if (obj_data)
174 { 173 {
175 if (obj_data->state) 174 free(obj_data->state);
176 free(obj_data->state);
177 free(obj_data); 175 free(obj_data);
178 } 176 }
179 _remove_obj_from_list(transit, obj); 177 _remove_obj_from_list(transit, obj);
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 0a375563a..37859ae10 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -3946,8 +3946,7 @@ _part_text_translatable_set(Eina_Inlist **translate_strings, const char *part, E
3946 eina_stringshare_del(ts->id); 3946 eina_stringshare_del(ts->id);
3947 eina_stringshare_del(ts->domain); 3947 eina_stringshare_del(ts->domain);
3948 eina_stringshare_del(ts->string); 3948 eina_stringshare_del(ts->string);
3949 free(ts); 3949 ELM_SAFE_FREE(ts, free);
3950 ts = NULL;
3951 } 3950 }
3952 } 3951 }
3953 3952
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 6b4eb874e..3ef1daca5 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -491,8 +491,8 @@ _shot_do(Elm_Win_Smart_Data *sd)
491 file, key, flags); 491 file, key, flags);
492 } 492 }
493 free(file); 493 free(file);
494 if (key) free(key); 494 free(key);
495 if (flags) free(flags); 495 free(flags);
496 ecore_evas_free(ee); 496 ecore_evas_free(ee);
497 if (sd->shot.repeat_count) sd->shot.shot_counter++; 497 if (sd->shot.repeat_count) sd->shot.shot_counter++;
498} 498}