From e502dc23f12f2d5f34524f3bb3ab59c5731d9123 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 8 Feb 2012 15:04:08 +0100 Subject: [PATCH] Fix a segfault when creating records --- swede | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/swede b/swede index cc2b21d..10325c3 100755 --- a/swede +++ b/swede @@ -611,6 +611,13 @@ if __name__ == '__main__': else: print genTLSA(args.host, args.protocol, args.port, cert, args.output, args.usage, args.selector, args.mtype) + # Clear the cert from memory (to stop M2Crypto from segfaulting) + # And cleanup the connection and context + cert=None + connection.clear() + connection.close() + ctx.close() + else: # Pass the path to the certificate to the genTLSA function if args.output == 'both': print genTLSA(args.host, args.protocol, args.port, args.certificate, 'draft', args.usage, args.selector, args.mtype) -- 2.36.1