@@ -592,7 +592,7 @@ static int nfs_do_mount_v3v2(struct nfsmount_info *mi,
struct sockaddr *sap, socklen_t salen)
{
struct mount_options *options = po_dup(mi->options);
- int result = 0;
+ int result = 0, save = 0;
if (!options) {
errno = ENOMEM;
@@ -637,7 +637,9 @@ static int nfs_do_mount_v3v2(struct nfsmount_info *mi,
result = nfs_sys_mount(mi, options);
out_fail:
+ save = errno;
po_destroy(options);
+ errno = save;
return result;
}
@@ -673,7 +675,7 @@ static int nfs_do_mount_v4(struct nfsmount_info *mi,
struct sockaddr *sap, socklen_t salen)
{
struct mount_options *options = po_dup(mi->options);
- int result = 0;
+ int result = 0, save = 0;
if (!options) {
errno = ENOMEM;
@@ -724,7 +726,9 @@ static int nfs_do_mount_v4(struct nfsmount_info *mi,
result = nfs_sys_mount(mi, options);
out_fail:
+ save = errno;
po_destroy(options);
+ errno = save;
return result;
}