fix "if (p) free(p)" constructs
This commit is contained in:
parent
e918e155ed
commit
6081868ee3
@ -157,7 +157,7 @@ static void sed_free_and_close_stuff(void)
|
||||
sed_cmd = sed_cmd_next;
|
||||
}
|
||||
|
||||
if (G.hold_space) free(G.hold_space);
|
||||
free(G.hold_space);
|
||||
|
||||
while (G.current_input_file < G.input_file_count)
|
||||
fclose(G.input_file_list[G.current_input_file++]);
|
||||
|
@ -5328,7 +5328,6 @@ expbackq(union node *cmd, int quoted, int quotes)
|
||||
p = buf;
|
||||
}
|
||||
|
||||
if (in.buf)
|
||||
free(in.buf);
|
||||
if (in.fd >= 0) {
|
||||
close(in.fd);
|
||||
@ -8788,7 +8787,6 @@ popfile(void)
|
||||
INT_OFF;
|
||||
if (pf->fd >= 0)
|
||||
close(pf->fd);
|
||||
if (pf->buf)
|
||||
free(pf->buf);
|
||||
while (pf->strpush)
|
||||
popstring();
|
||||
@ -10330,7 +10328,6 @@ parsebackq: {
|
||||
#endif
|
||||
savepbq = parsebackquote;
|
||||
if (setjmp(jmploc.loc)) {
|
||||
if (str)
|
||||
free(str);
|
||||
parsebackquote = 0;
|
||||
exception_handler = savehandler;
|
||||
@ -11264,7 +11261,6 @@ trapcmd(int argc, char **argv)
|
||||
else
|
||||
action = ckstrdup(action);
|
||||
}
|
||||
if (trap[signo])
|
||||
free(trap[signo]);
|
||||
trap[signo] = action;
|
||||
if (signo != 0)
|
||||
|
@ -455,7 +455,6 @@ static void free_job(struct job *cmd)
|
||||
for (i = 0; i < cmd->num_progs; i++) {
|
||||
free(cmd->progs[i].argv);
|
||||
#if ENABLE_LASH_PIPE_N_REDIRECTS
|
||||
if (cmd->progs[i].redirects)
|
||||
free(cmd->progs[i].redirects);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user