diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2011-04-13 10:19:18 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2011-04-13 10:19:18 +0300 |
commit | 338600c0115fa68fe85c4d601e85bf16965d3a91 (patch) | |
tree | 01257b03d23a3303d4d7df20eed4232a270874ac /io.c | |
parent | 933418a5f59d54887c43dc4fb9167faf1330db30 (diff) | |
download | egawk-338600c0115fa68fe85c4d601e85bf16965d3a91.tar.gz egawk-338600c0115fa68fe85c4d601e85bf16965d3a91.tar.bz2 egawk-338600c0115fa68fe85c4d601e85bf16965d3a91.zip |
Bug fixes, see ChangeLog.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -732,6 +732,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) fd = devopen(str, binmode("r")); if (fd == INVALID_HANDLE && errno == EISDIR) { *errflg = EISDIR; + /* do not free rp, saving it for reuse (save_rp = rp) */ return NULL; } rp->iop = iop_alloc(fd, str, NULL, TRUE); @@ -742,7 +743,7 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) #ifdef HAVE_SOCKETS if (inetfile(str, NULL, NULL)) { *errflg = errno; - free_rp(rp); + /* do not free rp, saving it for reuse (save_rp = rp) */ return NULL; } else #endif @@ -833,8 +834,10 @@ redirect(NODE *redir_exp, int redirtype, int *errflg) else fatal(_("can't redirect to `%s' (%s)"), str, strerror(errno)); - } else + } else { + /* do not free rp, saving it for reuse (save_rp = rp) */ return NULL; + } } } } |