git.annexia.org
/
miniexpect.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d27bfc
)
p2v: close the mexp handle if mexp_spawnv fails
author
Pino Toscano
<ptoscano@redhat.com>
Fri, 25 Jul 2014 15:36:17 +0000
(17:36 +0200)
committer
Richard W.M. Jones
<rjones@redhat.com>
Tue, 12 Aug 2014 11:21:51 +0000
(12:21 +0100)
miniexpect.c
patch
|
blob
|
history
diff --git
a/miniexpect.c
b/miniexpect.c
index
9e9cc0e
..
8c1efd9
100644
(file)
--- a/
miniexpect.c
+++ b/
miniexpect.c
@@
-121,7
+121,7
@@
mexp_spawnl (const char *file, const char *arg, ...)
mexp_h *
mexp_spawnv (const char *file, char **argv)
{
- mexp_h *h;
+ mexp_h *h
= NULL
;
int fd = -1;
int err;
char slave[1024];
@@
-197,6
+197,8
@@
mexp_spawnv (const char *file, char **argv)
close (fd);
if (pid > 0)
waitpid (pid, NULL, 0);
+ if (h != NULL)
+ mexp_close (h);
errno = err;
return NULL;
}