libxl: fix double free when doing xl save
PATCH 1/1 libxl: fix double free when doing xl save
Commit d2412fd63b14c6c21d0a3d4367afa448425dfb8a ("libxl: move common nic stuff into one source") introduced a double free error in libxl which occurred during "xl save".
Correct this error.
Signed-off-by Juergen Gross <[email protected]>
--- tools/libxl/libxl.c | 2 +- tools/libxl/libxl_nic.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
tools/libxl/libxl.c +1 -1
@@ -3228,7 +3228,7 @@ static int libxl__device_channel_from_xenstore(libxl__gc *gc,GCSPRINTF ("%s/name" , libxl_path), (const char **)(&channel->name));if (rc) goto out; - rc =libxl__xs_read_checked (NOGC ,XBT_NULL , + rc =libxl__xs_read_checked (gc,XBT_NULL ,GCSPRINTF ("%s/connection" , libxl_path), &tmp);if (rc) goto out;if (!strcmp (tmp,"pty" )) {
tools/libxl/libxl_nic.c +4 -4
@@ -321,19 +321,19 @@ static int libxl__device_nic_from_xenstore(libxl__gc *gc,memset (nic->mac,0 ,sizeof (nic->mac)); } - rc =libxl__xs_read_checked (gc,XBT_NULL , + rc =libxl__xs_read_checked (NOGC ,XBT_NULL ,GCSPRINTF ("%s/ip" , libxl_path), (const char **)(&nic->ip));if (rc) goto out; - rc =libxl__xs_read_checked (gc,XBT_NULL , + rc =libxl__xs_read_checked (NOGC ,XBT_NULL ,GCSPRINTF ("%s/bridge" , libxl_path), (const char **)(&nic->bridge));if (rc) goto out; - rc =libxl__xs_read_checked (gc,XBT_NULL , + rc =libxl__xs_read_checked (NOGC ,XBT_NULL ,GCSPRINTF ("%s/script" , libxl_path), (const char **)(&nic->script));if (rc) goto out; - rc =libxl__xs_read_checked (gc,XBT_NULL , + rc =libxl__xs_read_checked (NOGC ,XBT_NULL ,GCSPRINTF ("%s/forwarddev" , libxl_path), (const char **)(&nic->coloft_forwarddev));if (rc) goto out;
Signature · 7 lines
2.6.6 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 7 lines · Juergen Gross
Commit
d2412fd63b14c6c21d0a3d4367afa448425dfb8a("libxl: move common nic stuff into one source") introduced a double free error in libxl which occurred during "xl save".Correct this error.
Signed-off-by Juergen Gross <[email protected]>
Acked + applied
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel