mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
libqtest: only call fclose() on open files
libqtest.c can segfault when calling fclose() if the pidfile wasn't opened successfully. This patch fixes the issue. Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1367250772-17928-1-git-send-email-jlarrew@linux.vnet.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
08eb8c85e3
commit
beb54a87ba
1 changed files with 1 additions and 1 deletions
|
@ -99,8 +99,8 @@ static pid_t qtest_qemu_pid(QTestState *s)
|
|||
if (fgets(buffer, sizeof(buffer), f)) {
|
||||
pid = atoi(buffer);
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
fclose(f);
|
||||
return pid;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue