summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-09-28 09:57:49 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-09-28 15:09:50 +0100
commit55b7c4df7895b8c22d737723d857a9a63db69926 (patch)
treec2c80b878a237917694c7dfa190e2e5aa9fc1367
parent6cd040fcdf662ff56be08a03eb80918ec10191ec (diff)
downloadlibguestfs-55b7c4df7895b8c22d737723d857a9a63db69926.tar.gz
libguestfs-55b7c4df7895b8c22d737723d857a9a63db69926.tar.xz
libguestfs-55b7c4df7895b8c22d737723d857a9a63db69926.zip
virt-edit: If case_sensitive_path returns an error, exit.
The 'windows_path' function was blindly copied from virt-cat. In virt-cat, errors are checked by the caller to 'windows_path'. But virt-edit lacks this check. Change the function in virt-edit to add a check and exit on error.
-rw-r--r--edit/virt-edit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/edit/virt-edit.c b/edit/virt-edit.c
index 73d6f076..f7639264 100644
--- a/edit/virt-edit.c
+++ b/edit/virt-edit.c
@@ -646,6 +646,8 @@ windows_path (guestfs_h *g, const char *root, const char *path)
char *t = guestfs_case_sensitive_path (g, ret);
free (ret);
ret = t;
+ if (ret == NULL)
+ exit (EXIT_FAILURE);
return ret;
}