summaryrefslogtreecommitdiffstats
path: root/source/client/mount.cifs.c
diff options
context:
space:
mode:
authorSteve French <sfrench@samba.org>2007-04-28 16:56:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:45 -0500
commit4616c29b9f09b9863f1446e83c98e3adc327d0f9 (patch)
treeaa520cf79b6281e0d928c4ee4a418154cc226ece /source/client/mount.cifs.c
parent27c0f2970842a6e07875c5591ded6352acf36a4e (diff)
downloadsamba-4616c29b9f09b9863f1446e83c98e3adc327d0f9.tar.gz
samba-4616c29b9f09b9863f1446e83c98e3adc327d0f9.tar.xz
samba-4616c29b9f09b9863f1446e83c98e3adc327d0f9.zip
r22560: Clean up frees of realloc memory in mount.cifs (thanks to Alex for
reminding me how to use Valgrind).
Diffstat (limited to 'source/client/mount.cifs.c')
-rwxr-xr-xsource/client/mount.cifs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c
index 49150e1ffba..acc9f4e00e2 100755
--- a/source/client/mount.cifs.c
+++ b/source/client/mount.cifs.c
@@ -618,6 +618,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
nocopy:
data = next_keyword;
}
+ free(*optionsp);
*optionsp = out;
return 0;
}
@@ -1233,14 +1234,11 @@ mount_retry:
}
}
default:
-
printf("mount error %d = %s\n",errno,strerror(errno));
}
printf("Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)\n");
- if(mountpassword) {
- memset(mountpassword,0,64);
- }
- return -1;
+ rc = -1;
+ goto mount_exit;
} else {
pmntfile = setmntent(MOUNTED, "a+");
if(pmntfile) {
@@ -1283,6 +1281,8 @@ mount_retry:
printf("could not update mount table\n");
}
}
+ rc = 0;
+mount_exit:
if(mountpassword) {
int len = strlen(mountpassword);
memset(mountpassword,0,len);
@@ -1305,6 +1305,6 @@ mount_retry:
if(free_share_name) {
free(share_name);
}
- return 0;
+ return rc;
}