From 4c06ac06a13eaff5b314ad97cce824d615c06f9a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 6 Nov 2004 05:40:34 +0000 Subject: r3572: Thanks to tridge for his patience with my build breakage. This concludes the proper fixes. Andrew Bartlett (This used to be commit c1d025793f2994c8f1cab304c3394ab186654071) --- source4/lib/data_blob.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source4/lib/data_blob.c') diff --git a/source4/lib/data_blob.c b/source4/lib/data_blob.c index d2147be6b2..c5f15f1271 100644 --- a/source4/lib/data_blob.c +++ b/source4/lib/data_blob.c @@ -63,13 +63,18 @@ DATA_BLOB data_blob_talloc_named(TALLOC_CTX *mem_ctx, const void *p, size_t leng /******************************************************************* - construct a data blob which is a reference to another blob, in -the given mem context + reference a data blob, to the supplied TALLOC_CTX. + Returns a NULL DATA_BLOB on failure *******************************************************************/ DATA_BLOB data_blob_talloc_reference(TALLOC_CTX *mem_ctx, DATA_BLOB *blob) { DATA_BLOB ret = *blob; - ret.data = talloc_reference(mem_ctx, ret.data); + + ret.data = talloc_reference(mem_ctx, blob->data); + + if (!ret.data) { + return data_blob(NULL, 0); + } return ret; } -- cgit