libnetapi: don't to try to free NULL struct.
authorGünther Deschner <gd@samba.org>
Sun, 13 Apr 2008 15:33:27 +0000 (17:33 +0200)
committerGünther Deschner <gd@samba.org>
Sun, 13 Apr 2008 15:39:29 +0000 (17:39 +0200)
Guenther
(This used to be commit eb33d30d80ab2fe770e248f5b2a70a83a43dd156)

source3/lib/netapi/netapi.c

index cb218f0ced7ce3798b591b785949d6ba10abb65e..f15e5bf067cb22dd0ba5d0c11c8ea038f6588fe3 100644 (file)
@@ -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) {