* src/lxc_container.c (lxcContainerPivotRoot): Free and zero
oldroot *after* printing the diagnostic, both for virFileMakePath
and pivot_root failure.
+Wed Feb 4 22:22:34 +0100 2009 Jim Meyering <meyering@redhat.com>
+
+ lxc_container: Don't dereference NULL upon failure
+ * src/lxc_container.c (lxcContainerPivotRoot): Free and zero
+ oldroot *after* printing the diagnostic, both for virFileMakePath
+ and pivot_root failure.
+
Tue Feb 3 14:06:06 +0100 2009 Jim Meyering <meyering@redhat.com>
avoid a format-related warning
}
if ((rc = virFileMakePath(oldroot)) < 0) {
- VIR_FREE(oldroot);
virReportSystemError(NULL, rc,
_("failed to create %s"),
oldroot);
+ VIR_FREE(oldroot);
return -1;
}
/* The old root directory will live at /.oldroot after
* this and will soon be unmounted completely */
if (pivot_root(root->src, oldroot) < 0) {
- VIR_FREE(oldroot);
virReportSystemError(NULL, errno,
_("failed to pivot root %s to %s"),
oldroot, root->src);
+ VIR_FREE(oldroot);
return -1;
}
VIR_FREE(oldroot);
return 0;
}
-