mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
daemon: zfile: call pclose instead of fclose
fp was opened with popen, so close it properly.
This commit is contained in:
@@ -552,12 +552,12 @@ do_zfile (const char *method, const char *path)
|
||||
|
||||
if (fgets (line, sizeof line, fp) == NULL) {
|
||||
reply_with_perror ("fgets");
|
||||
fclose (fp);
|
||||
pclose (fp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fclose (fp) == -1) {
|
||||
reply_with_perror ("fclose");
|
||||
if (pclose (fp) == -1) {
|
||||
reply_with_perror ("pclose");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user