The Samba-Bugzilla – Attachment 6178 Details for
Bug 7897
Memory problems in winbind
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 3.5
7897-3.5.patch (text/plain), 3.56 KB, created by
Volker Lendecke
on 2011-01-02 08:34:33 UTC
(
hide
)
Description:
Patch for 3.5
Filename:
MIME Type:
Creator:
Volker Lendecke
Created:
2011-01-02 08:34:33 UTC
Size:
3.56 KB
patch
obsolete
>From b9293b50f4aa2cec8af6b3b7497b70457cbce1f9 Mon Sep 17 00:00:00 2001 >From: Volker Lendecke <vl@samba.org> >Date: Sun, 2 Jan 2011 02:48:03 +0100 >Subject: [PATCH 1/2] Fix a valgrind error > >Thanks to Tridge for the hint. > >Autobuild-User: Volker Lendecke <vlendec@samba.org> >Autobuild-Date: Sun Jan 2 10:58:51 CET 2011 on sn-devel-104 >--- > libcli/nbt/nbtname.c | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/libcli/nbt/nbtname.c b/libcli/nbt/nbtname.c >index 338cb21..5346ee3 100644 >--- a/libcli/nbt/nbtname.c >+++ b/libcli/nbt/nbtname.c >@@ -82,7 +82,9 @@ static enum ndr_err_code ndr_pull_component(struct ndr_pull *ndr, > return ndr_pull_error(ndr, NDR_ERR_STRING, > "BAD NBT NAME component"); > } >- *component = (uint8_t*)talloc_strndup(ndr, (const char *)&ndr->data[1 + *offset], len); >+ *component = (uint8_t*)talloc_strndup( >+ ndr->current_mem_ctx, >+ (const char *)&ndr->data[1 + *offset], len); > NDR_ERR_HAVE_NO_MEMORY(*component); > *offset += len + 1; > *max_offset = MAX(*max_offset, *offset); >@@ -126,7 +128,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_nbt_string(struct ndr_pull *ndr, int ndr_fla > "BAD NBT NAME too many components"); > } > if (num_components == 0) { >- name = talloc_strdup(ndr, ""); >+ name = talloc_strdup(ndr->current_mem_ctx, ""); > NDR_ERR_HAVE_NO_MEMORY(name); > } > >-- >1.7.3.2 > > >From 7d8de76ea19421bedd96a2d303bbd093afaa9502 Mon Sep 17 00:00:00 2001 >From: Volker Lendecke <vl@samba.org> >Date: Sun, 2 Jan 2011 07:42:57 +0100 >Subject: [PATCH 2/2] s3: Fix a memleak in receive_getdc_response > >--- > source3/libsmb/clidgram.c | 9 +++++++++ > 1 files changed, 9 insertions(+), 0 deletions(-) > >diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c >index f5dbd72..05fb5d3 100644 >--- a/source3/libsmb/clidgram.c >+++ b/source3/libsmb/clidgram.c >@@ -238,11 +238,13 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, > > if (blob.length < 4) { > DEBUG(0,("invalid length: %d\n", (int)blob.length)); >+ free_packet(packet); > return false; > } > > if (RIVAL(blob.data,0) != DGRAM_SMB) { > DEBUG(0,("invalid packet\n")); >+ free_packet(packet); > return false; > } > >@@ -253,11 +255,13 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, > (ndr_pull_flags_fn_t)ndr_pull_dgram_smb_packet); > if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { > DEBUG(0,("failed to parse packet\n")); >+ free_packet(packet); > return false; > } > > if (p.smb.smb_command != SMB_TRANSACTION) { > DEBUG(0,("invalid smb_command: %d\n", p.smb.smb_command)); >+ free_packet(packet); > return false; > } > >@@ -271,6 +275,7 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, > > status = pull_netlogon_samlogon_response(&blob, mem_ctx, NULL, &r); > if (!NT_STATUS_IS_OK(status)) { >+ free_packet(packet); > return false; > } > >@@ -285,11 +290,13 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, > if (!strequal(returned_domain, domain_name)) { > DEBUG(3, ("GetDC: Expected domain %s, got %s\n", > domain_name, returned_domain)); >+ free_packet(packet); > return false; > } > > *dc_name = talloc_strdup(mem_ctx, returned_dc); > if (!*dc_name) { >+ free_packet(packet); > return false; > } > >@@ -300,6 +307,7 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, > *_r = (struct netlogon_samlogon_response *)talloc_memdup( > mem_ctx, &r, sizeof(struct netlogon_samlogon_response)); > if (!*_r) { >+ free_packet(packet); > return false; > } > } >@@ -307,5 +315,6 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, > DEBUG(10, ("GetDC gave name %s for domain %s\n", > *dc_name, returned_domain)); > >+ free_packet(packet); > return True; > } >-- >1.7.3.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
metze
:
review+
Actions:
View
Attachments on
bug 7897
: 6178