svn commit: samba r1898 - branches/SAMBA_4_0/source/lib

idra at samba.org idra at samba.org
Wed Aug 18 21:22:08 GMT 2004


Author: idra
Date: 2004-08-18 21:22:07 +0000 (Wed, 18 Aug 2004)
New Revision: 1898

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=1898&nolog=1

Log:

Check the context we are going to return.


Modified:
   branches/SAMBA_4_0/source/lib/talloc.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc.c	2004-08-18 20:13:08 UTC (rev 1897)
+++ branches/SAMBA_4_0/source/lib/talloc.c	2004-08-18 21:22:07 UTC (rev 1898)
@@ -161,7 +161,11 @@
 	struct talloc_chunk *tc;
 	tc = ((struct talloc_chunk *)ptr)-1;
 
-	return tc->context;
+	if (tc->magic == TALLOC_MAGIC) {
+		return tc->context;
+	} else {
+		return NULL;
+	}
 }
 
 /** Allocate a bit of memory from the specified pool **/



More information about the samba-cvs mailing list