Changes by: uvman
Update of /cvs/linux-ntfs/ntfsprogs/ntfsprogs
In directory delta357:/tmp/cvs-serv5422/ntfsprogs
Modified Files:
ntfsmount.c
Log Message:
Change callers of malloc() to ntfs_malloc() (Szaka). Fix compilition (Yuval).
Index: ntfsmount.c
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -p -r1.86 -r1.87
--- ntfsmount.c 27 Oct 2006 14:15:32 -0000 1.86
+++ ntfsmount.c 1 Nov 2006 13:30:41 -0000 1.87
@@ -67,6 +67,7 @@
#include "utils.h"
#include "version.h"
#include "ntfstime.h"
+#include "misc.h"
#ifndef PATH_MAX
#define PATH_MAX 4096
@@ -148,7 +149,7 @@ static long ntfs_fuse_get_nr_free_mft_re
if (!(ctx->state & NF_FreeMFTOutdate))
return ctx->free_mft;
- buf = malloc(vol->cluster_size);
+ buf = ntfs_malloc(vol->cluster_size);
if (!buf)
return -ENOMEM;
while (1) {
@@ -180,7 +181,7 @@ static long ntfs_fuse_get_nr_free_cluste
if (!(ctx->state & NF_FreeClustersOutdate))
return ctx->free_clusters;
- buf = malloc(vol->cluster_size);
+ buf = ntfs_malloc(vol->cluster_size);
if (!buf)
return -ENOMEM;
while (1) {
@@ -378,7 +379,7 @@ static int ntfs_fuse_getattr(const char
!stream_name_len) {
INTX_FILE *intx_file;
- intx_file = malloc(na->data_size);
+ intx_file = ntfs_malloc(na->data_size);
if (!intx_file) {
res = -errno;
ntfs_attr_close(na);
@@ -474,7 +475,7 @@ static int ntfs_fuse_readlink(const char
goto exit;
}
/* Receive file content. */
- intx_file = malloc(na->data_size);
+ intx_file = ntfs_malloc(na->data_size);
if (!intx_file) {
res = -errno;
goto exit;
@@ -1400,11 +1401,10 @@ static struct fuse_operations ntfs_fuse_
static int ntfs_fuse_init(void)
{
- ctx = malloc(sizeof(ntfs_fuse_context_t));
- if (!ctx) {
- ntfs_log_perror("malloc failed");
+ ctx = ntfs_malloc(sizeof(ntfs_fuse_context_t));
+ if (!ctx)
return -1;
- }
+
*ctx = (ntfs_fuse_context_t) {
.state = NF_FreeClustersOutdate | NF_FreeMFTOutdate,
.uid = geteuid(),
@@ -1458,11 +1458,11 @@ static char *parse_mount_options(const c
* +1 for null-terminator.
* +PATH_MAX for resolved by realpath() device name.
*/
- ret = malloc(strlen(def_opts) + strlen(org_options) + 9 + PATH_MAX);
- if (!ret) {
- ntfs_log_perror("malloc failed");
+ ret = ntfs_malloc(strlen(def_opts) + strlen(org_options) + PATH_MAX +
+ 9);
+ if (!ret)
return NULL;
- }
+
*ret = 0;
options = strdup(org_options);
if (!options) {
|