diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-04-28 18:16:33 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:45 -0500 |
commit | e26dee48f079f429690584aa2666f498e08e6810 (patch) | |
tree | 8dc7f67920ddde9cde1e9e7baa0aa3dd5d189170 /source3/rpc_server | |
parent | a01c1968b53503594dad9c8d8817a6941a4eaeea (diff) | |
download | samba-e26dee48f079f429690584aa2666f498e08e6810.tar.gz samba-e26dee48f079f429690584aa2666f498e08e6810.tar.bz2 samba-e26dee48f079f429690584aa2666f498e08e6810.zip |
r22561: Fix a memleak in lanman.c: Nobody would free the session_list.
Volker
(This used to be commit 5d428400f77399b7fc30fb2a0fb10f0c74b96458)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_srvsvc_nt.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index 8f68bf36a1..bdd8f68d51 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -769,13 +769,12 @@ static void init_srv_sess_info_0(pipes_struct *p, struct srvsvc_NetSessCtr0 *ss0 { struct sessionid *session_list; uint32 num_entries = 0; - (*stot) = list_sessions(&session_list); + (*stot) = list_sessions(p->mem_ctx, &session_list); if (ss0 == NULL) { if (snum) { (*snum) = 0; } - SAFE_FREE(session_list); return; } @@ -799,7 +798,6 @@ static void init_srv_sess_info_0(pipes_struct *p, struct srvsvc_NetSessCtr0 *ss0 ss0->array = NULL; ss0->count = 0; } - SAFE_FREE(session_list); } /******************************************************************* @@ -859,7 +857,7 @@ static void init_srv_sess_info_1(pipes_struct *p, struct srvsvc_NetSessCtr1 *ss1 return; } - (*stot) = list_sessions(&session_list); + (*stot) = list_sessions(p->mem_ctx, &session_list); ss1->array = TALLOC_ARRAY(p->mem_ctx, struct srvsvc_NetSessInfo1, *stot); @@ -900,8 +898,6 @@ static void init_srv_sess_info_1(pipes_struct *p, struct srvsvc_NetSessCtr1 *ss1 if ((*snum) >= (*stot)) { (*snum) = 0; } - - SAFE_FREE(session_list); } /******************************************************************* @@ -1222,7 +1218,7 @@ WERROR _srvsvc_NetSessDel(pipes_struct *p, struct srvsvc_NetSessDel *r) memmove(machine, &machine[1], strlen(machine)); } - num_sessions = list_sessions(&session_list); + num_sessions = list_sessions(p->mem_ctx, &session_list); DEBUG(5,("_srv_net_sess_del: %d\n", __LINE__)); @@ -1248,10 +1244,7 @@ WERROR _srvsvc_NetSessDel(pipes_struct *p, struct srvsvc_NetSessDel *r) DEBUG(5,("_srv_net_sess_del: %d\n", __LINE__)); - done: - SAFE_FREE(session_list); - return status; } |