From: Pieter Lexis Date: Wed, 8 Feb 2012 14:04:08 +0000 (+0100) Subject: Fix a segfault when creating records X-Git-Url: https://git.svenne.dk/?a=commitdiff_plain;h=e502dc23f12f2d5f34524f3bb3ab59c5731d9123;p=public%2Fdnssec-swede-utility.git Fix a segfault when creating records --- 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)