small memory fix for samba4
Stefan (metze) Metzmacher
metze at metzemix.de
Sat Aug 16 23:10:37 GMT 2003
Hi tridge,
here's an other patch that reduce unused memory usage...
Index: smbd/process.c
===================================================================
RCS file: /cvsroot/samba4/source/smbd/process.c,v
retrieving revision 1.2
diff -u -r1.2 process.c
--- smbd/process.c 15 Aug 2003 20:19:30 -0000 1.2
+++ smbd/process.c 16 Aug 2003 23:07:47 -0000
@@ -718,6 +718,7 @@
struct server_context *smb;
TALLOC_CTX *mem_ctx;
struct fd_event fde;
+ char *socket_addr;
set_socket_options(fd,"SO_KEEPALIVE");
set_socket_options(fd, lp_socket_options());
@@ -737,8 +738,9 @@
/* set an initial client name based on its IP address. This will
be replaced with
the netbios name later if it gives us one */
- sub_set_remote_machine(strdup(get_socket_addr(smb->mem_ctx, fd)));
- smb->socket.client_addr = get_socket_addr(smb->mem_ctx, fd);
+ socket_addr = get_socket_addr(smb->mem_ctx, fd);
+ sub_set_remote_machine(socket_addr);
+ smb->socket.client_addr = socket_addr;
/* now initialise a few default values associated with this smb
socket */
smb->negotiate.max_send = 0xFFFF;
metze
-----------------------------------------------------------------------------
Stefan "metze" Metzmacher <metze at metzemix.de>
More information about the samba-technical
mailing list