[PATCH] qemud/qemud.c (qemudInitPaths): Remove unused code.

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

 



Here, "base" is set, gets memory allocated for it, and is written to,
then freed, but it is never used.

diff --git a/qemud/qemud.c b/qemud/qemud.c
index f88ed42..6b515d9 100644
--- a/qemud/qemud.c
+++ b/qemud/qemud.c
@@ -644,10 +644,8 @@ static int qemudInitPaths(struct qemud_server *server,
                           char *sockname,
                           char *roSockname,
                           int maxlen) {
-    char *base = 0;
     uid_t uid = geteuid();

-
     if (!uid) {
         if (snprintf (sockname, maxlen, "%s/run/libvirt/libvirt-sock",
                       LOCAL_STATE_DIR) >= maxlen)
@@ -678,15 +676,8 @@ static int qemudInitPaths(struct qemud_server *server,
         if (snprintf(server->logDir, PATH_MAX, "%s/.libvirt/log", pw->pw_dir) >= PATH_MAX)
             goto snprintf_error;

-        if (asprintf (&base, "%s/.libvirt", pw->pw_dir) == -1) {
-            qemudLog (QEMUD_ERR, "out of memory in asprintf");
-            return -1;
-        }
-
     } /* !remote */

-    if (base) free (base);
-
     return 0;

  snprintf_error:
--
1.5.3.7.949.g2221a6

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