Commit: c77dc5705e749d708843dd5c452fb4ca009b5969
Parent: 7dfcbddb8a9060e5320602782071b55e28580800
Author: opask
Date: Sun, 22 Jul 2018 20:42:21 -0600
remove mem_free from listedit.c, lru.c, mailto.c, main.c, memory.c
Diffstat:
5 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/listedit.c b/listedit.c
@@ -1053,7 +1053,7 @@ static int redraw_list_element(struct terminal *term, struct dialog_data *dlg, i
}
x+=draw_bfu_element(term,dlg->x+DIALOG_LB+x,y,color,bgcolor,fgcolor,element,(l->type)&4);
}
- mem_free(xp);
+ free(xp);
break;
default:
internal(
@@ -1087,7 +1087,7 @@ static int redraw_list_element(struct terminal *term, struct dialog_data *dlg, i
if (dlg->s)exclude_from_set(&(dlg->s),dlg->x+DIALOG_LB,y,dlg->x+DIALOG_LB+w,y+G_BFU_FONT_SIZE);
}
#endif
- mem_free(txt);
+ free(txt);
return text_position;
}
@@ -1220,7 +1220,7 @@ static void scroll_list(struct terminal *term, void *bla)
if (set) /* redraw rectangles in the set - we cannot redraw particular rectangles, we are only able to redraw whole window */
{
- mem_free(set);
+ free(set);
redraw_all:
redraw_list(term, bla);
}
@@ -1278,7 +1278,7 @@ static void list_search_for_back(void *rd_, unsigned char *str)
if (!*str) return;
if (!ld->open) return;
- if (ld->search_word) mem_free(ld->search_word);
+ free(ld->search_word);
ld->search_word = to_utf8_upcase(str, term_charset(rd->dlg->win->term));
ld->search_direction = -1;
@@ -1293,7 +1293,7 @@ static void list_search_for(void *rd_, unsigned char *str)
if (!*str) return;
if (!ld->open) return;
- if (ld->search_word) mem_free(ld->search_word);
+ free(ld->search_word);
ld->search_word = to_utf8_upcase(str, term_charset(rd->dlg->win->term));
ld->search_direction = 1;
@@ -1813,7 +1813,7 @@ static void close_list_window(struct dialog_data *dlg)
ld->open=0;
ld->dlg=NULL;
- if (ld->search_word) mem_free(ld->search_word);
+ free(ld->search_word);
ld->search_word=NULL;
if (ld->save) ld->save(d->udata);
}
diff --git a/lru.c b/lru.c
@@ -65,7 +65,7 @@ void lru_destroy_bottom(struct lru *cache)
cache->top = NULL;
row_delete(it);
- mem_free(it);
+ free(it);
}
/* Returns a value of "data"
diff --git a/mailto.c b/mailto.c
@@ -17,7 +17,7 @@ static void prog_func(struct terminal *term, struct list_head *list, unsigned ch
}
if ((cmd = subst_file(prog, param, 0))) {
exec_on_terminal(term, cmd, cast_uchar "", 1);
- mem_free(cmd);
+ free(cmd);
}
}
@@ -33,10 +33,10 @@ void mailto_func(struct session *ses, unsigned char *url)
add_to_strn(&m, host);
check_shell_security(&m);
prog_func(ses->term, &mailto_prog, m, TEXT_(T_MAIL));
- mem_free(m);
- mem_free(host);
+ free(m);
+ free(host);
fail1:
- mem_free(user);
+ free(user);
fail:
if (f) msg_box(ses->term, NULL, TEXT_(T_BAD_URL_SYNTAX), AL_CENTER, TEXT_(T_BAD_MAILTO_URL), MSG_BOX_END, NULL, 1, TEXT_(T_CANCEL), msg_box_null, B_ENTER | B_ESC);
}
diff --git a/main.c b/main.c
@@ -205,7 +205,7 @@ int attach_terminal(int in, int out, int ctl, void *info, int len)
set_nonblock(terminal_pipe[0]);
set_nonblock(terminal_pipe[1]);
handle_trm(in, out, out, terminal_pipe[1], ctl, info, len);
- mem_free(info);
+ free(info);
if ((term = init_term(terminal_pipe[0], out, win_func))) {
handle_basic_signals(term); /* OK, this is race condition, but it must be so; GPM installs it's own buggy TSTP handler */
return terminal_pipe[1];
@@ -221,7 +221,7 @@ int attach_g_terminal(unsigned char *cwd, void *info, int len)
{
struct terminal *term;
term = init_gfx_term(win_func, cwd, info, len);
- mem_free(info);
+ free(info);
return term ? 0 : -1;
}
@@ -252,11 +252,11 @@ void gfx_connection(int h)
hard_write(h, cast_uchar "x", 1);
EINTRLOOP(r, close(h));
}
- mem_free(info);
+ free(info);
return;
}
err_close_free:
- mem_free(info);
+ free(info);
err_close:
EINTRLOOP(r, close(h));
}
@@ -320,7 +320,7 @@ static void end_dump(struct object_request *r, void *p)
dump_to_file(fd->f_data, oh);
term_1:
reinit_f_data_c(fd);
- mem_free(fd);
+ free(fd);
}
if (r->state != O_OK) {
unsigned char *m = get_err_msg(r->stat.state);
@@ -391,7 +391,7 @@ static void init(void)
unsigned char *r;
if ((r = init_graphics(ggr_drv, ggr_mode, ggr_display))) {
fprintf(stderr, "%s", r);
- mem_free(r);
+ free(r);
retval = RET_SYNTAX;
goto ttt;
}
@@ -403,7 +403,7 @@ static void init(void)
add_to_strn(&n, cast_uchar "-");
add_to_strn(&n, nn);
}
- mem_free(n);
+ free(n);
}
init_dither(drv->depth);
}
@@ -430,7 +430,7 @@ static void init(void)
cwd = stracpy(cast_uchar "");
if (attach_g_terminal(cwd, info, len) < 0)
fatal_exit("Could not open initial session");
- mem_free(cwd);
+ free(cwd);
}
#endif
} else {
@@ -445,10 +445,10 @@ static void init(void)
}
uu = convert(get_commandline_charset(), utf8_table, u, NULL);
if (!(uuu = translate_url(uu, wd = get_cwd()))) uuu = stracpy(uu);
- mem_free(uu);
+ free(uu);
request_object(NULL, uuu, NULL, PRI_MAIN, NC_RELOAD, ALLOW_ALL, end_dump, NULL, &dump_obj);
- mem_free(uuu);
- if (wd) mem_free(wd);
+ free(uuu);
+ free(wd);
}
}
diff --git a/memory.c b/memory.c
@@ -90,7 +90,7 @@ void free_all_caches(void)
add_to_str(&m, &l, c->name);
}
internal("could not release entries from caches: %s", m);
- mem_free(m);
+ free(m);
}
free_list(struct cache_upcall, cache_upcalls);
}