summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-02-09 23:14:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:52 -0500
commitc96fc96de955ce5330af113abcee20645c8b5b78 (patch)
tree427f4fa190a87151ccc1de530219a7e72dbdd91b /source3
parentc1f9a387cb6ebc298f20c95d85301a8d30c9474d (diff)
downloadsamba-c96fc96de955ce5330af113abcee20645c8b5b78.tar.gz
samba-c96fc96de955ce5330af113abcee20645c8b5b78.tar.bz2
samba-c96fc96de955ce5330af113abcee20645c8b5b78.zip
r21265: Fix some valgrind errors -- not in 3_0
(This used to be commit b419a3407532efcd50f54c77927b3b3bb566845f)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 005c57e50a..615f5e1b07 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -80,8 +80,16 @@ static int pipe_enum_fn( TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf, voi
fenum->info[i].fid = (uint32)((procid_to_pid(&prec.pid)<<16) & prec.pnum);
fenum->info[i].permissions = (FILE_READ_DATA|FILE_WRITE_DATA);
fenum->info[i].num_locks = 0;
- fenum->info[i].user = uidtoname( prec.uid );
- fenum->info[i].path = fullpath;
+ if (!(fenum->info[i].user = talloc_strdup(
+ fenum->ctx, uidtoname(prec.uid)))) {
+ /* There's not much we can do here. */
+ fenum->info[i].user = "";
+ }
+ if (!(fenum->info[i].path = talloc_strdup(
+ fenum->ctx, fullpath))) {
+ /* There's not much we can do here. */
+ fenum->info[i].path = "";
+ }
fenum->count++;
}
@@ -172,8 +180,16 @@ static void enum_file_fn( const struct share_mode_entry *e,
fenum->info[i].fid = e->share_file_id;
fenum->info[i].permissions = permissions;
fenum->info[i].num_locks = num_locks;
- fenum->info[i].user = uidtoname(e->uid);
- fenum->info[i].path = fullpath;
+ if (!(fenum->info[i].user = talloc_strdup(
+ fenum->ctx, uidtoname(e->uid)))) {
+ /* There's not much we can do here. */
+ fenum->info[i].user = "";
+ }
+ if (!(fenum->info[i].path = talloc_strdup(
+ fenum->ctx, fullpath))) {
+ /* There's not much we can do here. */
+ fenum->info[i].path = "";
+ }
fenum->count++;
}
@@ -863,8 +879,14 @@ static void init_srv_sess_info_1(pipes_struct *p, struct srvsvc_NetSessCtr1 *ss1
num_files = net_count_files(pw->pw_uid, session_list[*snum].pid);
guest = strequal( session_list[*snum].username, lp_guestaccount() );
- ss1->array[num_entries].client = session_list[*snum].remote_machine;
- ss1->array[num_entries].user = session_list[*snum].username;
+ if (!(ss1->array[num_entries].client = talloc_strdup(
+ ss1->array, session_list[*snum].remote_machine))) {
+ ss1->array[num_entries].client = "";
+ }
+ if (!(ss1->array[num_entries].user = talloc_strdup(
+ ss1->array, session_list[*snum].username))) {
+ ss1->array[num_entries].user = "";
+ }
ss1->array[num_entries].num_open = num_files;
ss1->array[num_entries].time = connect_time;
ss1->array[num_entries].idle_time = 0;