Fossil SCM
Fixed a use of fclose() on a handle opened with popen(), noticed by Stephan Beal.
Commit
1f4b4fcb62a9c3297cd865adbca655edb9ab71648d1648b6ffdaedcfd6615eee
Parent
19bb3b88fa01e9e…
1 file changed
+1
-1
+1
-1
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -846,11 +846,11 @@ | ||
| 846 | 846 | } |
| 847 | 847 | }else if( p->zCmd ){ |
| 848 | 848 | FILE *out = popen(p->zCmd, "w"); |
| 849 | 849 | if( out ){ |
| 850 | 850 | fwrite(blob_buffer(&all), 1, blob_size(&all), out); |
| 851 | - fclose(out); | |
| 851 | + pclose(out); | |
| 852 | 852 | }else{ |
| 853 | 853 | emailerError(p, "Could not open output pipe \"%s\"", p->zCmd); |
| 854 | 854 | } |
| 855 | 855 | }else if( p->zDir ){ |
| 856 | 856 | char *zFile = file_time_tempname(p->zDir, ".email"); |
| 857 | 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 | 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 |