chiark / gitweb /
machinectl: fix minor memory leak
[elogind.git] / src / machine / machinectl.c
index 939b6481508dd52072756a2a2532eb90d46fb627..7ea991a81f1e15df594ec53e297f47bac6b3b6b0 100644 (file)
@@ -32,7 +32,7 @@
 #include <net/if.h>
 #include <sys/mount.h>
 #include <libgen.h>
-
+#undef basename
 #include "sd-bus.h"
 #include "log.h"
 #include "util.h"
@@ -1065,11 +1065,11 @@ static int copy_files(int argc, char *argv[], void *userdata) {
                 return -EINVAL;
         }
 
-        t = strdup(host_path);
+        t = strdupa(host_path);
         host_basename = basename(t);
         host_dirname = dirname(host_path);
 
-        t = strdup(container_path);
+        t = strdupa(container_path);
         container_basename = basename(t);
         container_dirname = dirname(container_path);
 
@@ -1760,8 +1760,8 @@ static int help(int argc, char *argv[], void *userdata) {
                "  list                        List running VMs and containers\n"
                "  status NAME...              Show VM/container details\n"
                "  show NAME...                Show properties of one or more VMs/containers\n"
-               "  login NAME                  Get a login prompt on a container\n"
                "  start NAME...               Start container as a service\n"
+               "  login NAME                  Get a login prompt on a container\n"
                "  enable NAME...              Enable automatic container start at boot\n"
                "  disable NAME...             Disable automatic container start at boot\n"
                "  poweroff NAME...            Power off one or more containers\n"
@@ -1778,8 +1778,8 @@ static int help(int argc, char *argv[], void *userdata) {
                "  clone NAME NAME             Clone an image\n"
                "  rename NAME NAME            Rename an image\n"
                "  read-only NAME [BOOL]       Mark or unmark image read-only\n"
-               "  remove NAME...              Remove an image\n",
-               program_invocation_short_name);
+               "  remove NAME...              Remove an image\n"
+               program_invocation_short_name);
 
         return 0;
 }