Merge branch 'libradsec' into libradsec-server-support
[libradsec.git] / lib / radsec.c
index db406ae..fed02c3 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright 2010, 2011 NORDUnet A/S. All rights reserved.
-   See LICENSE for licensing information.  */
+/* Copyright 2010-2013 NORDUnet A/S. All rights reserved.
+   See LICENSE for licensing information. */
 
 #if defined HAVE_CONFIG_H
 #include <config.h>
@@ -107,11 +107,11 @@ rs_context_destroy (struct rs_context *ctx)
                   evutil_freeaddrinfo (p->addr_cache);
                   p->addr_cache = NULL;
                 }
+              rs_free (ctx, p->transport_cred);
              p = p->next;
              rs_free (ctx, tmp);
            }
          free (r->name);
-          rs_free (ctx, r->transport_cred);
          r = r->next;
          rs_free (ctx, tmp);
        }
@@ -127,6 +127,9 @@ rs_context_destroy (struct rs_context *ctx)
       rs_free (ctx, ctx->config);
     }
 
+  if (ctx->evb)
+    event_base_free (ctx->evb);
+
   free (ctx);
 }