Index: src/xm_internal.c =================================================================== RCS file: /data/cvs/libxen/src/xm_internal.c,v retrieving revision 1.123 diff -u -r1.123 xm_internal.c --- src/xm_internal.c 3 Apr 2009 12:38:52 -0000 1.123 +++ src/xm_internal.c 14 Apr 2009 10:40:25 -0000 @@ -1624,7 +1624,7 @@ const char *filename; xenXMConfCachePtr entry; virBuffer mapbuf = VIR_BUFFER_INITIALIZER; - char *mapstr = NULL; + char *mapstr = NULL, *mapsave = NULL; int i, j, n, comma = 0; int ret = -1; char *cpuset = NULL; @@ -1679,6 +1679,7 @@ } mapstr = virBufferContentAndReset(&mapbuf); + mapsave = mapstr; if (VIR_ALLOC_N(cpuset, maxcpu) < 0) { virReportOOMError(domain->conn); @@ -1700,7 +1701,7 @@ ret = 0; cleanup: - VIR_FREE(mapstr); + VIR_FREE(mapsave); VIR_FREE(cpuset); xenUnifiedUnlock(priv); return (ret);