diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 06fbe55..21fd468 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -2986,7 +2986,10 @@ static int qemudDomainChangeCDROM(virDomainPtr dom,
     }
     VIR_FREE(reply);
     VIR_FREE(cmd);
-    strcpy(olddisk->src, newdisk->src);
+
+    VIR_FREE(olddisk->src);
+    olddisk->src = newdisk->src;
+    newdisk->src = NULL;
     olddisk->type = newdisk->type;
     return 0;
 }
