summaryrefslogtreecommitdiffstats
path: root/source3/modules/vfs_recycle.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-12-31 18:06:57 -0800
committerJeremy Allison <jra@samba.org>2008-12-31 18:06:57 -0800
commit07e0094365e8dc360a83eec2e7cf9b1d5d8d6d00 (patch)
tree412f448d68b4b0f36c5b330a1f3eef77acf12a2f /source3/modules/vfs_recycle.c
parentbb23f5725f538d14b2ccec0463cfb1136be3ebd0 (diff)
downloadsamba-07e0094365e8dc360a83eec2e7cf9b1d5d8d6d00.tar.gz
samba-07e0094365e8dc360a83eec2e7cf9b1d5d8d6d00.tar.xz
samba-07e0094365e8dc360a83eec2e7cf9b1d5d8d6d00.zip
Fix all warnings in source3 with gcc4.3.
Jeremy.
Diffstat (limited to 'source3/modules/vfs_recycle.c')
-rw-r--r--source3/modules/vfs_recycle.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c
index acc1936e5f..cb985e1be2 100644
--- a/source3/modules/vfs_recycle.c
+++ b/source3/modules/vfs_recycle.c
@@ -525,7 +525,9 @@ static int recycle_unlink(vfs_handle_struct *handle, const char *file_name)
}
if (recycle_keep_dir_tree(handle) == True) {
- asprintf(&temp_name, "%s/%s", repository, path_name);
+ if (asprintf(&temp_name, "%s/%s", repository, path_name) == -1) {
+ ALLOC_CHECK(temp_name, done);
+ }
} else {
temp_name = SMB_STRDUP(repository);
}
@@ -543,8 +545,9 @@ static int recycle_unlink(vfs_handle_struct *handle, const char *file_name)
}
}
- asprintf(&final_name, "%s/%s", temp_name, base);
- ALLOC_CHECK(final_name, done);
+ if (asprintf(&final_name, "%s/%s", temp_name, base) == -1) {
+ ALLOC_CHECK(final_name, done);
+ }
DEBUG(10, ("recycle: recycled file name: %s\n", final_name)); /* new filename with path */
/* check if we should delete file from recycle bin */
@@ -561,7 +564,9 @@ static int recycle_unlink(vfs_handle_struct *handle, const char *file_name)
i = 1;
while (recycle_file_exist(handle, final_name)) {
SAFE_FREE(final_name);
- asprintf(&final_name, "%s/Copy #%d of %s", temp_name, i++, base);
+ if (asprintf(&final_name, "%s/Copy #%d of %s", temp_name, i++, base) == -1) {
+ ALLOC_CHECK(final_name, done);
+ }
}
DEBUG(10, ("recycle: Moving %s to %s\n", file_name, final_name));