Page MenuHomeFreeBSD

D4126.id10314.diff
No OneTemporary

D4126.id10314.diff

Index: b/popen.c
===================================================================
--- b/popen.c
+++ b/popen.c
@@ -145,7 +145,6 @@
}
THREAD_UNLOCK();
- /* Parent; assume fdopen can't fail. */
if (*type == 'r') {
iop = fdopen(pdes[0], type);
(void)_close(pdes[1]);
@@ -154,6 +153,13 @@
(void)_close(pdes[0]);
}
+ /* Parent: adding check for fdopen failure. */
+ if (iop == NULL) {
+ (void)_close(pdes[(*type == 'r') ? 0 : 1]); /* close used pipe-end */
+ free(cur);
+ return (NULL);
+ }
+
/* Link into list of file descriptors. */
cur->fp = iop;
cur->pid = pid;

File Metadata

Mime Type
text/plain
Expires
Thu, Aug 27, 7:49 AM (6 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37364989
Default Alt Text
D4126.id10314.diff (593 B)

Event Timeline