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

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



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


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