small memory fix for samba4

Stefan (metze) Metzmacher metze at metzemix.de
Sat Aug 16 23:15:19 GMT 2003


I add the patch as attachment...
(My mail client didn't handle TAB's right if I send it in the mail...:-( )

please you this attached patch when you apply it...

At 01:10 17.08.2003 +0200, Stefan (metze) Metzmacher wrote:
>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>


metze
-----------------------------------------------------------------------------
Stefan "metze" Metzmacher <metze at metzemix.de> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4_0-sock_addr-02.diff
Type: application/octet-stream
Size: 1023 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20030817/616b4126/4_0-sock_addr-02.obj


More information about the samba-technical mailing list