svn commit: samba r19400 - in branches/SAMBA_4_0/source/lib/registry: .

tridge at samba.org tridge at samba.org
Wed Oct 18 21:37:38 GMT 2006


Author: tridge
Date: 2006-10-18 21:37:37 +0000 (Wed, 18 Oct 2006)
New Revision: 19400

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19400

Log:

fixed a valgrind error in the directory registry backend (name was
used after closedir(), which invalidates the name)

Modified:
   branches/SAMBA_4_0/source/lib/registry/reg_backend_dir.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/registry/reg_backend_dir.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/reg_backend_dir.c	2006-10-18 21:24:20 UTC (rev 19399)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_dir.c	2006-10-18 21:37:37 UTC (rev 19400)
@@ -99,9 +99,9 @@
 			if(S_ISDIR(stbuf.st_mode)) {
 				if(i == idx) {
 					(*key) = talloc(mem_ctx, struct registry_key);
-					(*key)->name = e->d_name;
+					(*key)->name = talloc_strdup(*key, e->d_name);
 					(*key)->path = NULL;
-					(*key)->backend_data = talloc_strdup(mem_ctx, thispath);
+					(*key)->backend_data = talloc_strdup(*key, thispath);
 					SAFE_FREE(thispath);
 					closedir(d);
 					return WERR_OK;



More information about the samba-cvs mailing list