[libvirt] [PATCH]: don't crash when calling libvirt_lxc without arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In this case we reference def with is NULL. O.k. to apply?
Cheers,
 -- Guido
>From ff82eb24e50b4f80769bd932ca739e8a2539edb4 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx@xxxxxxxxxxx>
Date: Mon, 4 May 2009 21:29:15 +0200
Subject: [PATCH 1/2] don't crash with def == NULL

happens when calling libvirt_lxc without arguments
---
 src/lxc_controller.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/lxc_controller.c b/src/lxc_controller.c
index 3f9add2..e0fb05d 100644
--- a/src/lxc_controller.c
+++ b/src/lxc_controller.c
@@ -745,7 +745,8 @@ int main(int argc, char *argv[])
 
 
 cleanup:
-    virFileDeletePid(LXC_STATE_DIR, def->name);
+    if (def)
+        virFileDeletePid(LXC_STATE_DIR, def->name);
     lxcControllerCleanupInterfaces(nveths, veths);
     unlink(sockpath);
     VIR_FREE(sockpath);
-- 
1.6.2.4

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]