diff options
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -165,19 +165,18 @@ capture_new(SV *program, ARGV argv, unsigned timeout, SV *cb[2], SV *input) void capture_DESTROY(struct capture *cp) { if (cp->program != &PL_sv_undef) SvREFCNT_dec(cp->program); - if (cp->input != &PL_sv_undef) { + if (cp->input != &PL_sv_undef) SvREFCNT_dec(cp->input); - /* Make sure runcap_free won't free the input sc_base pointer - */ - cp->rc.rc_cap[RUNCAP_STDIN].sc_base = NULL; - cp->rc.rc_cap[RUNCAP_STDIN].sc_fd = -1; - } + /* Make sure runcap_free won't free the input sc_base pointer + */ + cp->rc.rc_cap[RUNCAP_STDIN].sc_base = NULL; + cp->rc.rc_cap[RUNCAP_STDIN].sc_fd = -1; free(cp->closure[0].str); if (cp->closure[0].cv != &PL_sv_undef) SvREFCNT_dec(cp->closure[0].cv); free(cp->closure[1].str); @@ -275,9 +274,9 @@ capture_run(struct capture *cp) call_monitor(cp->closure[1].cv, cp->closure[1].str, cp->closure[1].len); cp->closure[1].len = 0; } - return res; + return res == 0; } |