aboutsummaryrefslogtreecommitdiffstats
path: root/mount.cifs.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@samba.org>2017-02-23 19:09:12 -0500
committerJeff Layton <jlayton@samba.org>2017-02-24 07:12:14 -0500
commit4850d321c3ec8f1b31b162fe8a316a7638c12b94 (patch)
treebbbb9b98917bf66e7524ac1754cf2ee54a6809dc /mount.cifs.c
parent2333c502f81c66e186123e1b739a056fb049d5e4 (diff)
downloadcifs-utils-4850d321c3ec8f1b31b162fe8a316a7638c12b94.tar.gz
cifs-utils-4850d321c3ec8f1b31b162fe8a316a7638c12b94.tar.xz
cifs-utils-4850d321c3ec8f1b31b162fe8a316a7638c12b94.zip
treewide: Eliminate SAFE_FREE
It just frees and then zeroes out the pointer. That's of dubious value in the places where it's currently being used. Just use free() instead. Signed-off-by: Jeff Layton <jlayton@samba.org>
Diffstat (limited to 'mount.cifs.c')
-rw-r--r--mount.cifs.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/mount.cifs.c b/mount.cifs.c
index b2bcb7f..13b71ef 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -61,6 +61,7 @@
#include "mount.h"
#include "util.h"
#include "resolve_host.h"
+#include "data_blob.h"
#ifndef MS_MOVE
#define MS_MOVE 8192
@@ -101,13 +102,6 @@
/* Max password size. */
#define MOUNT_PASSWD_SIZE 512
-
-
-#ifndef SAFE_FREE
-#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x = NULL; } } while (0)
-#endif
-
-
/*
* mount.cifs has been the subject of many "security" bugs that have arisen
* because of users and distributions installing it as a setuid root program
@@ -621,7 +615,7 @@ return_i:
/* make sure passwords are scrubbed from memory */
if (line_buf != NULL)
memset(line_buf, 0, line_buf_size);
- SAFE_FREE(line_buf);
+ free(line_buf);
return i;
}
@@ -1516,7 +1510,7 @@ add_mtab(char *devname, char *mountpoint, unsigned long flags, const char *fstyp
rc = EX_FILEIO;
}
unlock_mtab();
- SAFE_FREE(mountent.mnt_opts);
+ free(mountent.mnt_opts);
add_mtab_exit:
toggle_dac_capability(1, 0);
sigprocmask(SIG_SETMASK, &oldmask, NULL);
@@ -2152,7 +2146,7 @@ mount_exit:
memset(parsed_info->password, 0, sizeof(parsed_info->password));
munmap(parsed_info, sizeof(*parsed_info));
}
- SAFE_FREE(options);
- SAFE_FREE(orgoptions);
+ free(options);
+ free(orgoptions);
return rc;
}