Avoid segfault upon early libvirtd failure.

* qemud/qemud.c (main): Don't call qemudCleanup on an
uninitialized pointer.
This commit is contained in:
Jim Meyering 2008-03-03 18:10:19 +00:00
parent 6a17c6c652
commit f9e94c2e13
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,9 @@
Mon Mar 3 19:09:51 CET 2008 Jim Meyering <meyering@redhat.com>
Avoid segfault upon early libvirtd failure.
* qemud/qemud.c (main): Don't call qemudCleanup on an
uninitialized pointer.
Mon Mar 3 15:40:31 CET 2008 Daniel Veillard <veillard@redhat.com> Mon Mar 3 15:40:31 CET 2008 Daniel Veillard <veillard@redhat.com>
* NEWS configure.in libvirt.spec.in docs/* include/libvirt/libvirt.h * NEWS configure.in libvirt.spec.in docs/* include/libvirt/libvirt.h

View File

@ -2025,7 +2025,7 @@ libvirt management daemon:\n\
#define MAX_LISTEN 5 #define MAX_LISTEN 5
int main(int argc, char **argv) { int main(int argc, char **argv) {
struct qemud_server *server; struct qemud_server *server = NULL;
struct sigaction sig_action; struct sigaction sig_action;
int sigpipe[2]; int sigpipe[2];
const char *pid_file = NULL; const char *pid_file = NULL;
@ -2180,6 +2180,7 @@ int main(int argc, char **argv) {
unlink (pid_file); unlink (pid_file);
error1: error1:
if (server)
qemudCleanup(server); qemudCleanup(server);
return ret; return ret;
} }