From: Maxime Villard <rustyBSD@gmx.fr>

Subject: [E-devel] [e][PATCH] Optimizations v2
Date: Fri, 21 Dec 2012 22:17:32 +0100

Hi,
same patch as before: removed useless nullchecks and
switched some free()'s to E_FREE().



SVN revision: 81592
This commit is contained in:
Maxime Villard 2012-12-21 21:31:13 +00:00 committed by Mike Blumenkrantz
parent d11c1cc6b1
commit 4a52c46268
23 changed files with 78 additions and 97 deletions

View File

@ -78,7 +78,6 @@ _battery_openbsd_start(void)
void void
_battery_openbsd_stop(void) _battery_openbsd_stop(void)
{ {
if (ac)
free(ac); free(ac);
if (bat) if (bat)
{ {

View File

@ -567,8 +567,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
} }
if (!_e_mod_comp_win_shaped_check(cw, cw->rects, cw->rects_num)) if (!_e_mod_comp_win_shaped_check(cw, cw->rects, cw->rects_num))
{ {
free(cw->rects); E_FREE(cw->rects);
cw->rects = NULL;
cw->rects_num = 0; cw->rects_num = 0;
} }
if ((cw->rects) && (!cw->shaped)) if ((cw->rects) && (!cw->shaped))
@ -1941,7 +1940,7 @@ _e_mod_comp_win_add(E_Comp *c,
cw->title = ecore_x_icccm_title_get(cw->win); cw->title = ecore_x_icccm_title_get(cw->win);
if (ecore_x_netwm_name_get(cw->win, &netwm_title)) if (ecore_x_netwm_name_get(cw->win, &netwm_title))
{ {
if (cw->title) free(cw->title); free(cw->title);
cw->title = netwm_title; cw->title = netwm_title;
} }
ecore_x_icccm_name_class_get(cw->win, &cw->name, &cw->clas); ecore_x_icccm_name_class_get(cw->win, &cw->name, &cw->clas);
@ -2092,11 +2091,7 @@ _e_mod_comp_win_del(E_Comp_Win *cw)
e_mod_comp_update_free(cw->up); e_mod_comp_update_free(cw->up);
DBG(" [0x%x] del\n", cw->win); DBG(" [0x%x] del\n", cw->win);
if (cw->rects) E_FREE(cw->rects);
{
free(cw->rects);
cw->rects = NULL;
}
if (cw->update_timeout) if (cw->update_timeout)
{ {
ecore_timer_del(cw->update_timeout); ecore_timer_del(cw->update_timeout);
@ -2159,10 +2154,10 @@ _e_mod_comp_win_del(E_Comp_Win *cw)
if (cw->inhash) if (cw->inhash)
eina_hash_del(windows, e_util_winid_str_get(cw->win), cw); eina_hash_del(windows, e_util_winid_str_get(cw->win), cw);
if (cw->title) free(cw->title); free(cw->title);
if (cw->name) free(cw->name); free(cw->name);
if (cw->clas) free(cw->clas); free(cw->clas);
if (cw->role) free(cw->role); free(cw->role);
cw->c->wins_invalid = 1; cw->c->wins_invalid = 1;
cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw)); cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw));
pending_count = cw->pending_count; pending_count = cw->pending_count;
@ -3836,8 +3831,8 @@ _e_mod_comp_add(E_Manager *man)
ecore_x_sync(); ecore_x_sync();
continue; continue;
} }
if (wname) free(wname); free(wname);
if (wclass) free(wclass); free(wclass);
wname = wclass = NULL; wname = wclass = NULL;
cw = _e_mod_comp_win_add(c, wins[i]); cw = _e_mod_comp_win_add(c, wins[i]);
if (!cw) continue; if (!cw) continue;

View File

@ -28,7 +28,7 @@ e_mod_comp_update_new(void)
void void
e_mod_comp_update_free(E_Update *up) e_mod_comp_update_free(E_Update *up)
{ {
if (up->tiles) free(up->tiles); free(up->tiles);
free(up); free(up);
} }

View File

@ -414,7 +414,7 @@ _e_mod_comp_wl_shell_surface_set_title(struct wl_client *client, struct wl_resou
LOGFN(__FILE__, __LINE__, __FUNCTION__); LOGFN(__FILE__, __LINE__, __FUNCTION__);
wss = resource->data; wss = resource->data;
if (wss->title) free(wss->title); free(wss->title);
wss->title = strdup(title); wss->title = strdup(title);
} }
@ -426,7 +426,7 @@ _e_mod_comp_wl_shell_surface_set_class(struct wl_client *client, struct wl_resou
LOGFN(__FILE__, __LINE__, __FUNCTION__); LOGFN(__FILE__, __LINE__, __FUNCTION__);
wss = resource->data; wss = resource->data;
if (wss->clas) free(wss->clas); free(wss->clas);
wss->clas = strdup(clas); wss->clas = strdup(clas);
} }

View File

@ -206,10 +206,10 @@ _match_free(Match_Config *m)
if (m->match.clas) eina_stringshare_del(m->match.clas); if (m->match.clas) eina_stringshare_del(m->match.clas);
if (m->match.role) eina_stringshare_del(m->match.role); if (m->match.role) eina_stringshare_del(m->match.role);
if (m->match.shadow_style) eina_stringshare_del(m->match.shadow_style); if (m->match.shadow_style) eina_stringshare_del(m->match.shadow_style);
if (m->title) free(m->title); free(m->title);
if (m->name) free(m->name); free(m->name);
if (m->clas) free(m->clas); free(m->clas);
if (m->role) free(m->role); free(m->role);
free(m); free(m);
} }
@ -615,32 +615,28 @@ _edit_ok(void *d1,
if (m->title) if (m->title)
{ {
if (m->title[0]) m->match.title = eina_stringshare_add(m->title); if (m->title[0]) m->match.title = eina_stringshare_add(m->title);
free(m->title); E_FREE(m->title);
m->title = NULL;
} }
if (m->match.name) eina_stringshare_del(m->match.name); if (m->match.name) eina_stringshare_del(m->match.name);
m->match.name = NULL; m->match.name = NULL;
if (m->name) if (m->name)
{ {
if (m->name[0]) m->match.name = eina_stringshare_add(m->name); if (m->name[0]) m->match.name = eina_stringshare_add(m->name);
free(m->name); E_FREE(m->name);
m->name = NULL;
} }
if (m->match.clas) eina_stringshare_del(m->match.clas); if (m->match.clas) eina_stringshare_del(m->match.clas);
m->match.clas = NULL; m->match.clas = NULL;
if (m->clas) if (m->clas)
{ {
if (m->clas[0]) m->match.clas = eina_stringshare_add(m->clas); if (m->clas[0]) m->match.clas = eina_stringshare_add(m->clas);
free(m->clas); E_FREE(m->clas);
m->clas = NULL;
} }
if (m->match.role) eina_stringshare_del(m->match.role); if (m->match.role) eina_stringshare_del(m->match.role);
m->match.role = NULL; m->match.role = NULL;
if (m->role) if (m->role)
{ {
if (m->role[0]) m->match.role = eina_stringshare_add(m->role); if (m->role[0]) m->match.role = eina_stringshare_add(m->role);
free(m->role); E_FREE(m->role);
m->role = NULL;
} }
m->match.borderless = m->borderless; m->match.borderless = m->borderless;
m->match.dialog = m->dialog; m->match.dialog = m->dialog;

View File

@ -126,10 +126,8 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
if (cfdata->hdl) if (cfdata->hdl)
ecore_event_handler_del(cfdata->hdl); ecore_event_handler_del(cfdata->hdl);
eina_stringshare_del(cfdata->bg); eina_stringshare_del(cfdata->bg);
if (cfdata->name)
E_FREE(cfdata->name); E_FREE(cfdata->name);
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) #if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
if (cfdata->profile)
E_FREE(cfdata->profile); E_FREE(cfdata->profile);
#endif #endif
E_FREE(cfdata); E_FREE(cfdata);

View File

@ -178,7 +178,7 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
eina_stringshare_del(cfdata->locals.binding); eina_stringshare_del(cfdata->locals.binding);
eina_stringshare_del(cfdata->locals.action); eina_stringshare_del(cfdata->locals.action);
if (cfdata->locals.params) free(cfdata->locals.params); free(cfdata->locals.params);
E_FREE(cfdata); E_FREE(cfdata);
} }
@ -644,7 +644,7 @@ _update_action_list(E_Config_Dialog_Data *cfdata)
else else
{ {
e_widget_ilist_unselect(cfdata->gui.o_action_list); e_widget_ilist_unselect(cfdata->gui.o_action_list);
if (cfdata->locals.action) free(cfdata->locals.action); free(cfdata->locals.action);
cfdata->locals.action = strdup(""); cfdata->locals.action = strdup("");
e_widget_entry_clear(cfdata->gui.o_params); e_widget_entry_clear(cfdata->gui.o_params);
} }
@ -924,7 +924,7 @@ _edge_grab_wnd_show(E_Config_Dialog_Data *cfdata)
{ {
label = _edge_binding_text_get(cfdata->locals.edge, ((float)cfdata->locals.delay), cfdata->locals.modifiers); label = _edge_binding_text_get(cfdata->locals.edge, ((float)cfdata->locals.delay), cfdata->locals.modifiers);
edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label); edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
if (label) E_FREE(label); E_FREE(label);
} }
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
@ -971,7 +971,7 @@ _edge_grab_wnd_slider_changed_cb(void *data, Evas_Object *obj __UNUSED__)
((float)cfdata->locals.delay), ((float)cfdata->locals.delay),
cfdata->locals.modifiers); cfdata->locals.modifiers);
edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label); edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
if (label) E_FREE(label); E_FREE(label);
} }
static void static void
@ -994,7 +994,7 @@ _edge_grab_wnd_check_changed_cb(void *data, Evas_Object *obj __UNUSED__)
} }
edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label); edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
if (label) E_FREE(label); E_FREE(label);
} }
static void static void
@ -1078,7 +1078,7 @@ stop:
cfdata->locals.click ? (-1.0 * cfdata->locals.button) : ((float)cfdata->locals.delay), cfdata->locals.click ? (-1.0 * cfdata->locals.button) : ((float)cfdata->locals.delay),
cfdata->locals.modifiers); cfdata->locals.modifiers);
edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label); edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
if (label) E_FREE(label); E_FREE(label);
} }
static void static void

View File

@ -175,8 +175,8 @@ _free_data(E_Config_Dialog *cfd __UNUSED__,
eina_stringshare_del(cfdata->locals.binding); eina_stringshare_del(cfdata->locals.binding);
eina_stringshare_del(cfdata->locals.action); eina_stringshare_del(cfdata->locals.action);
if (cfdata->locals.params) free(cfdata->locals.params); free(cfdata->locals.params);
if (cfdata->params) free(cfdata->params); free(cfdata->params);
E_FREE(cfdata); E_FREE(cfdata);
} }
@ -785,7 +785,7 @@ _update_action_list(E_Config_Dialog_Data *cfdata)
else else
{ {
e_widget_ilist_unselect(cfdata->gui.o_action_list); e_widget_ilist_unselect(cfdata->gui.o_action_list);
if (cfdata->locals.action) free(cfdata->locals.action); free(cfdata->locals.action);
cfdata->locals.action = strdup(""); cfdata->locals.action = strdup("");
e_widget_entry_clear(cfdata->gui.o_params); e_widget_entry_clear(cfdata->gui.o_params);
} }

View File

@ -191,7 +191,7 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
eina_stringshare_del(cfdata->locals.action); eina_stringshare_del(cfdata->locals.action);
eina_stringshare_del(cfdata->locals.cur); eina_stringshare_del(cfdata->locals.cur);
if (cfdata->locals.params) free(cfdata->locals.params); free(cfdata->locals.params);
E_FREE(cfdata); E_FREE(cfdata);
} }
@ -756,8 +756,8 @@ _update_mouse_binding_list(E_Config_Dialog_Data *cfdata)
snprintf(label, sizeof(label), "%s + %s", button ? button : "", mods); snprintf(label, sizeof(label), "%s + %s", button ? button : "", mods);
else else
snprintf(label, sizeof(label), "%s", button ? button : ""); snprintf(label, sizeof(label), "%s", button ? button : "");
if (button) free(button); free(button);
if (mods) free(mods); free(mods);
switch (eb->button) switch (eb->button)
{ {
@ -817,8 +817,8 @@ _update_mouse_binding_list(E_Config_Dialog_Data *cfdata)
snprintf(label, sizeof(label), "%s + %s", button ? button : "", mods); snprintf(label, sizeof(label), "%s + %s", button ? button : "", mods);
else else
snprintf(label, sizeof(label), "%s", button ? button : ""); snprintf(label, sizeof(label), "%s", button ? button : "");
if (button) free(button); free(button);
if (mods) free(mods); free(mods);
snprintf(val, sizeof(val), "w%d", i); snprintf(val, sizeof(val), "w%d", i);

View File

@ -233,8 +233,8 @@ _create_menus_list(Evas *evas, E_Config_Dialog_Data *cfdata)
} }
} }
e_widget_ilist_append(ob, NULL, label, NULL, NULL, file); e_widget_ilist_append(ob, NULL, label, NULL, NULL, file);
if (tlabel) free(tlabel); free(tlabel);
if (tdesc) free(tdesc); free(tdesc);
free(file); free(file);
i++; i++;
} }

View File

@ -77,8 +77,8 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
if (evr->val) eina_stringshare_del(evr->val); if (evr->val) eina_stringshare_del(evr->val);
E_FREE(evr); E_FREE(evr);
} }
if (cfdata->var_str) free(cfdata->var_str); free(cfdata->var_str);
if (cfdata->val_str) free(cfdata->val_str); free(cfdata->val_str);
E_FREE(cfdata); E_FREE(cfdata);
} }

View File

@ -498,7 +498,7 @@ e_smart_monitor_changes_apply(Evas_Object *obj)
noutputs, mx, my, noutputs, mx, my,
sd->current.mode->xid, sd->current.mode->xid,
sd->current.orientation); sd->current.orientation);
if (outputs) free(outputs); free(outputs);
} }
} }
else else

View File

@ -691,7 +691,7 @@ _pan_sel(Evas_Object *obj, Item *it)
if (it2->selected) it2->selected = 0; if (it2->selected) it2->selected = 0;
} }
it->selected = EINA_TRUE; it->selected = EINA_TRUE;
if (sd->info->bg_file) free(sd->info->bg_file); free(sd->info->bg_file);
evas_object_hide(sd->info->mini); evas_object_hide(sd->info->mini);
if (it->file) if (it->file)
{ {
@ -710,7 +710,7 @@ _pan_sel(Evas_Object *obj, Item *it)
if (p) *p = 0; if (p) *p = 0;
} }
edje_object_part_text_set(sd->info->bg, "e.text.filename", name); edje_object_part_text_set(sd->info->bg, "e.text.filename", name);
if (name) free(name); free(name);
} }
else else
{ {
@ -947,7 +947,7 @@ _pan_file_add(Evas_Object *obj, const char *file, Eina_Bool remote, Eina_Bool th
if (p) *p = 0; if (p) *p = 0;
} }
edje_object_part_text_set(sd->info->bg, "e.text.filename", name); edje_object_part_text_set(sd->info->bg, "e.text.filename", name);
if (name) free(name); free(name);
} }
} }
} }
@ -1074,8 +1074,7 @@ _idler(void *data)
} }
if (!eina_iterator_next(info->dir, (void**) &st)) if (!eina_iterator_next(info->dir, (void**) &st))
{ {
free(info->curdir); E_FREE(info->curdir);
info->curdir = NULL;
eina_iterator_free(info->dir); eina_iterator_free(info->dir);
info->dir = NULL; info->dir = NULL;
info->idler = NULL; info->idler = NULL;
@ -1108,7 +1107,7 @@ _scan(Info *info)
edje_object_part_text_set(info->bg, "e.text.busy_label", edje_object_part_text_set(info->bg, "e.text.busy_label",
_("Loading files...")); _("Loading files..."));
} }
if (info->curdir) free(info->curdir); free(info->curdir);
info->curdir = info->dirs->data; info->curdir = info->dirs->data;
info->dirs = eina_list_remove_list(info->dirs, info->dirs); info->dirs = eina_list_remove_list(info->dirs, info->dirs);
if (!info->dir) info->dir = eina_file_stat_ls(info->curdir); if (!info->dir) info->dir = eina_file_stat_ls(info->curdir);
@ -1162,8 +1161,7 @@ wp_browser_new(E_Container *con)
win = e_win_new(con); win = e_win_new(con);
if (!win) if (!win)
{ {
free(info); E_FREE(info);
info = NULL;
return NULL; return NULL;
} }
info->win = win; info->win = win;
@ -1328,8 +1326,7 @@ wp_broser_free(Info *info)
free(s); free(s);
if (info->idler) ecore_idler_del(info->idler); if (info->idler) ecore_idler_del(info->idler);
// del other stuff // del other stuff
free(info); E_FREE(info);
info = NULL;
} }
E_Config_Dialog * E_Config_Dialog *

View File

@ -550,7 +550,7 @@ _cpufreq_status_free(Status *s)
free(l->data); free(l->data);
eina_list_free(s->governors); eina_list_free(s->governors);
} }
if (s->cur_governor) free(s->cur_governor); free(s->cur_governor);
if (s->orig_governor) eina_stringshare_del(s->orig_governor); if (s->orig_governor) eina_stringshare_del(s->orig_governor);
free(s); free(s);
} }
@ -834,7 +834,7 @@ _cpufreq_status_check_current(Status *s)
{ {
ret = 1; ret = 1;
if (s->cur_governor) free(s->cur_governor); free(s->cur_governor);
s->cur_governor = strdup(buf); s->cur_governor = strdup(buf);
for (i = strlen(s->cur_governor) - 1; i >= 0; i--) for (i = strlen(s->cur_governor) - 1; i >= 0; i--)

View File

@ -212,8 +212,8 @@ _ds_shutdown(Dropshadow *ds)
_ds_shadow_del(sh); _ds_shadow_del(sh);
} }
if (ds->idler_before) e_main_idler_before_del(ds->idler_before); if (ds->idler_before) e_main_idler_before_del(ds->idler_before);
if (ds->table.gauss) free(ds->table.gauss); free(ds->table.gauss);
if (ds->table.gauss2) free(ds->table.gauss2); free(ds->table.gauss2);
_ds_shared_free(ds); _ds_shared_free(ds);
free(ds); free(ds);
} }
@ -1083,7 +1083,7 @@ _ds_blur_init(Dropshadow *ds)
{ {
int i; int i;
if (ds->table.gauss) free(ds->table.gauss); free(ds->table.gauss);
ds->table.gauss_size = (ds->conf->blur_size * 2) - 1; ds->table.gauss_size = (ds->conf->blur_size * 2) - 1;
ds->table.gauss = calloc(1, ds->table.gauss_size * sizeof(unsigned char)); ds->table.gauss = calloc(1, ds->table.gauss_size * sizeof(unsigned char));
@ -1098,7 +1098,7 @@ _ds_blur_init(Dropshadow *ds)
_ds_gauss_int(-1.5 + (v * 3.0)) * 255.0; _ds_gauss_int(-1.5 + (v * 3.0)) * 255.0;
} }
if (ds->table.gauss2) free(ds->table.gauss2); free(ds->table.gauss2);
ds->table.gauss2_size = (ds->conf->blur_size * 2) - 1; ds->table.gauss2_size = (ds->conf->blur_size * 2) - 1;
ds->table.gauss2 = calloc(1, ds->table.gauss2_size * sizeof(unsigned char)); ds->table.gauss2 = calloc(1, ds->table.gauss2_size * sizeof(unsigned char));
@ -1484,7 +1484,7 @@ static void
_ds_shpix_free(Shpix *sp) _ds_shpix_free(Shpix *sp)
{ {
if (!sp) return; if (!sp) return;
if (sp->pix) free(sp->pix); free(sp->pix);
free(sp); free(sp);
} }
@ -1968,8 +1968,7 @@ _tilebuf_intersect(int tsize, int tlen, int tnum, int x, int w, int *x1, int *x2
static void static void
_tilebuf_setup(Tilebuf *tb) _tilebuf_setup(Tilebuf *tb)
{ {
if (tb->tiles.tiles) free(tb->tiles.tiles); E_FREE(tb->tiles.tiles);
tb->tiles.tiles = NULL;
tb->tiles.w = (tb->outbuf_w + (tb->tile_size.w - 1)) / tb->tile_size.w; tb->tiles.w = (tb->outbuf_w + (tb->tile_size.w - 1)) / tb->tile_size.w;
tb->tiles.h = (tb->outbuf_h + (tb->tile_size.h - 1)) / tb->tile_size.h; tb->tiles.h = (tb->outbuf_h + (tb->tile_size.h - 1)) / tb->tile_size.h;
@ -2004,7 +2003,7 @@ _tilebuf_new(int w, int h)
static void static void
_tilebuf_free(Tilebuf *tb) _tilebuf_free(Tilebuf *tb)
{ {
if (tb->tiles.tiles) free(tb->tiles.tiles); free(tb->tiles.tiles);
free(tb); free(tb);
} }

View File

@ -1262,9 +1262,7 @@ _plugins_shutdown(void)
_dir_monitor_free(); _dir_monitor_free();
if (current_path) E_FREE(current_path);
free(current_path);
current_path = NULL;
} }
/***************************************************************************/ /***************************************************************************/

View File

@ -356,7 +356,7 @@ _il_home_desktop_find_border(E_Zone *zone, Efreet_Desktop *desktop)
if (e_exec_startup_id_pid_find(bd->client.netwm.pid, if (e_exec_startup_id_pid_find(bd->client.netwm.pid,
bd->client.netwm.startup_id) == desktop) bd->client.netwm.startup_id) == desktop)
{ {
if (exe) free(exe); free(exe);
return bd; return bd;
} }
if (exe) if (exe)
@ -381,7 +381,7 @@ _il_home_desktop_find_border(E_Zone *zone, Efreet_Desktop *desktop)
} }
} }
} }
if (exe) free(exe); free(exe);
return NULL; return NULL;
} }

View File

@ -415,7 +415,7 @@ e_kbd_dict_save(E_Kbd_Dict *kd)
else else
fprintf(f, "%s %i\n", wd, usage); fprintf(f, "%s %i\n", wd, usage);
} }
if (wd) free(wd); free(wd);
p = pn; p = pn;
if (p >= (kd->file.dict + kd->file.size)) break; if (p >= (kd->file.dict + kd->file.size)) break;
} }
@ -585,7 +585,7 @@ e_kbd_dict_word_usage_adjust(E_Kbd_Dict *kd, const char *word, int adjust)
// FIXME: we need to find an EXACT line match - case and all // FIXME: we need to find an EXACT line match - case and all
wd = _e_kbd_dict_line_parse(kd, line, &usage); wd = _e_kbd_dict_line_parse(kd, line, &usage);
if (wd) free(wd); free(wd);
} }
usage += adjust; usage += adjust;
_e_kbd_dict_changed_write_add(kd, word, usage); _e_kbd_dict_changed_write_add(kd, word, usage);

View File

@ -124,9 +124,9 @@ _e_kbd_int_layout_buf_update(E_Kbd_Int *ki)
s3 = strdup(_e_kbd_int_str_unquote(out_capslock)); s3 = strdup(_e_kbd_int_str_unquote(out_capslock));
e_kbd_buf_layout_key_add(ki->kbuf, s1, s2, s3, e_kbd_buf_layout_key_add(ki->kbuf, s1, s2, s3,
ky->x, ky->y, ky->w, ky->h); ky->x, ky->y, ky->w, ky->h);
if (s1) free(s1); free(s1);
if (s2) free(s2); free(s2);
if (s3) free(s3); free(s3);
} }
} }
} }
@ -913,7 +913,7 @@ _e_kbd_int_layout_free(E_Kbd_Int *ki)
{ {
E_Kbd_Int_Key *ky; E_Kbd_Int_Key *ky;
if (ki->layout.directory) free(ki->layout.directory); free(ki->layout.directory);
if (ki->layout.file) eina_stringshare_del(ki->layout.file); if (ki->layout.file) eina_stringshare_del(ki->layout.file);
ki->layout.directory = NULL; ki->layout.directory = NULL;
ki->layout.file = NULL; ki->layout.file = NULL;
@ -999,8 +999,7 @@ _e_kbd_int_layout_parse(E_Kbd_Int *ki, const char *layout)
if (!ky) continue; if (!ky) continue;
if (sscanf(buf, "%*s %i %i %i %i\n", &(ky->x), &(ky->orig_y), &(ky->w), &(ky->orig_h)) != 4) if (sscanf(buf, "%*s %i %i %i %i\n", &(ky->x), &(ky->orig_y), &(ky->w), &(ky->orig_h)) != 4)
{ {
free(ky); E_FREE(ky);
ky = NULL;
continue; continue;
} }
ki->layout.keys = eina_list_append(ki->layout.keys, ky); ki->layout.keys = eina_list_append(ki->layout.keys, ky);

View File

@ -153,7 +153,7 @@ _e_mod_illume_config_policy_policies_get(void)
e_object_del(E_OBJECT(p)); e_object_del(E_OBJECT(p));
continue; continue;
} }
if (file) free(file); free(file);
l = eina_list_append(l, p); l = eina_list_append(l, p);
} }

View File

@ -46,7 +46,7 @@ e_mod_policy_init(void)
{ {
/* loading policy failed, bail out */ /* loading policy failed, bail out */
printf("Cannot load policy: %s\n", file); printf("Cannot load policy: %s\n", file);
if (file) free(file); free(file);
return 0; return 0;
} }
@ -493,7 +493,7 @@ _e_mod_policy_cb_policy_change(void *data __UNUSED__, int type, void *event __UN
/* try to load the policy */ /* try to load the policy */
_e_mod_policy_load(file); _e_mod_policy_load(file);
if (file) free(file); free(file);
return ECORE_CALLBACK_PASS_ON; return ECORE_CALLBACK_PASS_ON;
} }

View File

@ -134,9 +134,9 @@ _e_mod_illume_config_select_window_list_changed(void *data)
break; break;
} }
if (title) free(title); free(title);
if (name) free(name); free(name);
if (class) free(class); free(class);
if (_sw_change_timer) ecore_timer_del(_sw_change_timer); if (_sw_change_timer) ecore_timer_del(_sw_change_timer);
_sw_change_timer = _sw_change_timer =
@ -235,9 +235,9 @@ _e_mod_illume_config_select_window_match(E_Border *bd)
break; break;
} }
if (title) free(title); free(title);
if (name) free(name); free(name);
if (class) free(class); free(class);
return match; return match;
} }

View File

@ -484,7 +484,7 @@ _win_share_cb(void *data __UNUSED__, void *data2 __UNUSED__)
return; return;
} }
rewind(f); rewind(f);
if (fdata) free(fdata); free(fdata);
fdata = malloc(fsize); fdata = malloc(fsize);
if (!fdata) if (!fdata)
{ {