scriptlive: free resource at the and
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
ab61a03881
commit
263835e824
|
@ -105,6 +105,17 @@ struct replay_setup *replay_new_setup(void)
|
|||
return xcalloc(1, sizeof(struct replay_setup));
|
||||
}
|
||||
|
||||
void replay_free_setup(struct replay_setup *stp)
|
||||
{
|
||||
if (!stp)
|
||||
return;
|
||||
|
||||
free(stp->logs);
|
||||
free(stp->step.name);
|
||||
free(stp->step.value);
|
||||
free(stp);
|
||||
}
|
||||
|
||||
/* if timing file does not contains types of entries (old format) than use this
|
||||
* type as the default */
|
||||
int replay_set_default_type(struct replay_setup *stp, char type)
|
||||
|
|
|
@ -27,7 +27,7 @@ struct replay_step;
|
|||
|
||||
void replay_init_debug(void);
|
||||
struct replay_setup *replay_new_setup(void);
|
||||
|
||||
void replay_free_setup(struct replay_setup *stp);
|
||||
|
||||
int replay_set_default_type(struct replay_setup *stp, char type);
|
||||
int replay_set_crmode(struct replay_setup *stp, int mode);
|
||||
|
|
|
@ -318,8 +318,6 @@ main(int argc, char *argv[])
|
|||
cb->child_sigstop = child_sigstop;
|
||||
cb->mainloop = mainloop_cb;
|
||||
|
||||
sigprocmask(SIG_BLOCK, NULL, ul_pty_get_orig_sigset(ss.pty));
|
||||
|
||||
if (ul_pty_setup(ss.pty))
|
||||
err(EXIT_FAILURE, "failed to create pseudo-terminal");
|
||||
|
||||
|
@ -378,7 +376,9 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
ul_pty_cleanup(ss.pty);
|
||||
fprintf(stdout, _("\n>>> scriptlive: done. <<<\n"));
|
||||
ul_free_pty(ss.pty);
|
||||
replay_free_setup(ss.setup);
|
||||
|
||||
fprintf(stdout, _("\n>>> scriptlive: done. <<<\n"));
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -307,5 +307,7 @@ main(int argc, char *argv[])
|
|||
replay_get_timing_file(setup),
|
||||
replay_get_timing_line(setup));
|
||||
printf("\n");
|
||||
replay_free_setup(setup);
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue