[libvirt] [PATCH] remove useless code

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

 



Barely worth posting for review, but who knows...

>From a7cae36a3d966e80d82859d63c60a303b63d6720 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@xxxxxxxxxx>
Date: Wed, 4 Feb 2009 17:44:24 +0100
Subject: [PATCH] remove useless code

* src/bridge.c (brAddTap): Remove redundant errno=ENOMEM assignment
after failed strdup.
* src/cgroup.c (virCgroupFree): Remove redundant *group=NULL assignment
after VIR_FREE(*group).
---
 src/bridge.c |    6 ++----
 src/cgroup.c |    1 -
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/bridge.c b/src/bridge.c
index 9c4ca74..990a567 100644
--- a/src/bridge.c
+++ b/src/bridge.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Red Hat, Inc.
+ * Copyright (C) 2007, 2009 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -539,10 +539,8 @@ brAddTap(brControl *ctl,
             if ((errno = brSetInterfaceUp(ctl, try.ifr_name, 1)))
                 goto error;
             VIR_FREE(*ifname);
-            if (!(*ifname = strdup(try.ifr_name))) {
-                errno = ENOMEM;
+            if (!(*ifname = strdup(try.ifr_name)))
                 goto error;
-            }
             *tapfd = fd;
             return 0;
         }
diff --git a/src/cgroup.c b/src/cgroup.c
index 1b4c27f..8bd6e87 100644
--- a/src/cgroup.c
+++ b/src/cgroup.c
@@ -51,7 +51,6 @@ void virCgroupFree(virCgroupPtr *group)
     if (*group != NULL) {
         VIR_FREE((*group)->path);
         VIR_FREE(*group);
-        *group = NULL;
     }
 }

--
1.6.1.2.467.g081e7

--
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]