Fossil SCM

Fixed a use of fclose() on a handle opened with popen(), noticed by Stephan Beal.

wyoung 2018-12-04 23:08 trunk
Commit 1f4b4fcb62a9c3297cd865adbca655edb9ab71648d1648b6ffdaedcfd6615eee
1 file changed +1 -1
+1 -1
--- src/alerts.c
+++ src/alerts.c
@@ -846,11 +846,11 @@
846846
}
847847
}else if( p->zCmd ){
848848
FILE *out = popen(p->zCmd, "w");
849849
if( out ){
850850
fwrite(blob_buffer(&all), 1, blob_size(&all), out);
851
- fclose(out);
851
+ pclose(out);
852852
}else{
853853
emailerError(p, "Could not open output pipe \"%s\"", p->zCmd);
854854
}
855855
}else if( p->zDir ){
856856
char *zFile = file_time_tempname(p->zDir, ".email");
857857
--- src/alerts.c
+++ src/alerts.c
@@ -846,11 +846,11 @@
846 }
847 }else if( p->zCmd ){
848 FILE *out = popen(p->zCmd, "w");
849 if( out ){
850 fwrite(blob_buffer(&all), 1, blob_size(&all), out);
851 fclose(out);
852 }else{
853 emailerError(p, "Could not open output pipe \"%s\"", p->zCmd);
854 }
855 }else if( p->zDir ){
856 char *zFile = file_time_tempname(p->zDir, ".email");
857
--- src/alerts.c
+++ src/alerts.c
@@ -846,11 +846,11 @@
846 }
847 }else if( p->zCmd ){
848 FILE *out = popen(p->zCmd, "w");
849 if( out ){
850 fwrite(blob_buffer(&all), 1, blob_size(&all), out);
851 pclose(out);
852 }else{
853 emailerError(p, "Could not open output pipe \"%s\"", p->zCmd);
854 }
855 }else if( p->zDir ){
856 char *zFile = file_time_tempname(p->zDir, ".email");
857

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button