summaryrefslogtreecommitdiff
path: root/source4/libnet/libnet.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libnet/libnet.c')
-rw-r--r--source4/libnet/libnet.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c
index d1605bc17d..c966898cee 100644
--- a/source4/libnet/libnet.c
+++ b/source4/libnet/libnet.c
@@ -28,20 +28,17 @@ struct libnet_context *libnet_context_init(struct event_context *ev,
{
struct libnet_context *ctx;
+ /* We require an event context here */
+ if (!ev) {
+ return NULL;
+ }
+
/* create brand new libnet context */
ctx = talloc(ev, struct libnet_context);
if (!ctx) {
return NULL;
}
- /* events */
- if (ev == NULL) {
- ev = event_context_find(ctx);
- if (ev == NULL) {
- talloc_free(ctx);
- return NULL;
- }
- }
ctx->event_ctx = ev;
ctx->lp_ctx = lp_ctx;