summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-05-23 12:37:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:53:53 -0500
commita64be8dbdd9e3e2aecb696b38925cc8f15a91f36 (patch)
treeb92f2a245d826fc6c396d1617935031967e61a81 /source4
parent4a137a7cf154955db5d1b1bb67017575a428d737 (diff)
downloadsamba-a64be8dbdd9e3e2aecb696b38925cc8f15a91f36.tar.gz
samba-a64be8dbdd9e3e2aecb696b38925cc8f15a91f36.tar.bz2
samba-a64be8dbdd9e3e2aecb696b38925cc8f15a91f36.zip
r830: Use pull_ucs2_talloc() instead of acnv_u2ux() and fix a memory leak.
(This used to be commit ad88561becf59cd38a3e329e68cbe5518a3373d7)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
index a28f1880db..e4f9447488 100644
--- a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
+++ b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
@@ -919,7 +919,7 @@ static WERROR vk_to_val(REG_KEY *parent, VK_HDR *vk_hdr, int size, REG_VAL **val
if (dat_len&0x7FFFFFFF) {
- char *dtmp = (char *)malloc(dat_len&0x7FFFFFFF);
+ char *dtmp = (char *)talloc(tmp->mem_ctx, dat_len&0x7FFFFFFF);
tmp->data_blk = dtmp;
@@ -1085,15 +1085,12 @@ static WERROR nk_to_key(REG_HANDLE *h, NK_HDR *nk_hdr, int size, REG_KEY *parent
if (clsname_len) { /* Just print in Ascii for now */
smb_ucs2_t *clsnamep;
int clsnam_off;
- char *clsnameu;
clsnam_off = IVAL(&nk_hdr->clsnam_off,0);
clsnamep = (smb_ucs2_t *)LOCN(regf->base, clsnam_off);
DEBUG(2, ("Class Name Offset: %0X\n", clsnam_off));
- clsnameu = acnv_u2ux(clsnamep);
- tmp->class_name = talloc_strdup(tmp->mem_ctx, clsnameu);
- SAFE_FREE(clsnameu);
+ pull_ucs2_talloc(tmp->mem_ctx, &tmp->class_name, clsnamep);
DEBUGADD(2,(" Class Name: %s\n", cls_name));