daemon: zfile: call pclose instead of fclose

fp was opened with popen, so close it properly.
This commit is contained in:
Pino Toscano
2014-08-18 11:18:23 +02:00
parent 54887a3eea
commit 06aa1bff0f

View File

@@ -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;
}