summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/libnet.c11
-rw-r--r--source4/libnet/libnet.h2
2 files changed, 2 insertions, 11 deletions
diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c
index b7b18b7417..ba995854b2 100644
--- a/source4/libnet/libnet.c
+++ b/source4/libnet/libnet.c
@@ -26,7 +26,6 @@ struct libnet_context *libnet_context_init(struct event_context *ev)
{
/* default name resolution methods */
const char *nr_methods[] = { "lmhosts", "wins", "host", "bcast", NULL };
- int nr_count = 0, nr_i;
struct libnet_context *ctx;
@@ -46,15 +45,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev)
}
ctx->event_ctx = ev;
- /* count name resolution methods */
- while (nr_methods[nr_count]) nr_count++;
-
- /* assign name resolution methods */
- ctx->name_res_methods = talloc_array(ctx, char*, nr_count+1);
- for (nr_i = 0; nr_i < nr_count; nr_i++) {
- ctx->name_res_methods[nr_i] = talloc_strdup(ctx, nr_methods[nr_i]);
- }
- ctx->name_res_methods[nr_i] = NULL;
+ ctx->name_res_methods = str_list_copy(ctx, nr_methods);
return ctx;
}
diff --git a/source4/libnet/libnet.h b/source4/libnet/libnet.h
index 18dc376628..be22439590 100644
--- a/source4/libnet/libnet.h
+++ b/source4/libnet/libnet.h
@@ -33,7 +33,7 @@ struct libnet_context {
struct policy_handle user_handle;
/* name resolution methods */
- char **name_res_methods;
+ const char **name_res_methods;
struct event_context *event_ctx;
};