summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/netapi/netapi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c
index cb218f0ced..f15e5bf067 100644
--- a/source3/lib/netapi/netapi.c
+++ b/source3/lib/netapi/netapi.c
@@ -117,6 +117,10 @@ NET_API_STATUS libnetapi_getctx(struct libnetapi_ctx **ctx)
NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx)
{
+ if (!ctx) {
+ return NET_API_STATUS_SUCCESS;
+ }
+
libnetapi_shutdown_cm(ctx);
if (ctx->krb5_cc_env) {