summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2016-05-06 15:30:57 +1200
committerAndrew Bartlett <abartlet@samba.org>2016-05-10 01:43:14 +0200
commit891abcf78f50a6badc1cd6f9a6d408e4727ba61a (patch)
tree9ade20d410b6f0a7c7aee10cf66f05fcc5b617fe /source4/lib
parent8a3c9056bd0a51dbaffe5ebb3299a2b490cbc650 (diff)
downloadsamba-891abcf78f50a6badc1cd6f9a6d408e4727ba61a.tar.gz
source4/registry/local: avoid str_list_length() to check first element
We don't need to walk to the end of the list to find out if the first one is NULL. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/registry/local.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/lib/registry/local.c b/source4/lib/registry/local.c
index 2afb65c7d59..6079efd6543 100644
--- a/source4/lib/registry/local.c
+++ b/source4/lib/registry/local.c
@@ -389,7 +389,7 @@ WERROR reg_mount_hive(struct registry_context *rctx,
mp->path.predefined_key = key_id;
mp->prev = mp->next = NULL;
mp->key = hive_key;
- if (elements != NULL && str_list_length(elements) != 0) {
+ if (elements != NULL && elements[0] != NULL) {
mp->path.elements = talloc_array(mp, const char *,
str_list_length(elements));
W_ERROR_HAVE_NO_MEMORY(mp->path.elements);