Skip to contentSkip to conversation

libxenlight: fix cd-insert cli arguments parsing

PATCH New Stefano Stabellini 1 participant 1 message Dec 9, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxenlight: fix cd-insert cli arguments parsing

Hi all,
this patch fixes a bug in the command line arguments parsing code of cd_insert.

---

tools/libxl/xl.c +3 -3
diff -r 9d22971d3f32 tools/libxl/xl.c
@@ -904,10 +904,10 @@
                 disk.phystype = PHYSTYPE_FILE;
             }
         } else {
-            p = '\0';
-            disk.physpath = strdup(p);
+            *p = '\0';
             p++;
-            libxl_string_to_phystype(&ctx, p, &disk.phystype);
+            disk.physpath = p;
+            libxl_string_to_phystype(&ctx, phys, &disk.phystype);
         }
     } else {
             disk.physpath = NULL;