Don't free config object until we destroy the context.
[radsecproxy.git] / lib / radsec.c
index 45c4f42..afb871e 100644 (file)
@@ -142,13 +142,16 @@ void rs_context_destroy(struct rs_context *ctx)
       r = r->next;
       rs_free (ctx, tmp);
     }
-  dict_free ();
+
+  if (ctx->cfg)
+    cfg_free (ctx->cfg);
+  ctx->cfg = NULL;
+
   rs_free (ctx, ctx);
 }
 
 int rs_context_set_alloc_scheme(struct rs_context *ctx,
                                struct rs_alloc_scheme *scheme)
 {
-  return rs_err_ctx_push_fl (ctx, RSE_NOSYS, __FILE__, __LINE__,
-                            "%s: NYI", __func__);
+  return rs_err_ctx_push_fl (ctx, RSE_NOSYS, __FILE__, __LINE__, NULL);
 }