pki: Reset variable so error handling works properly
authorTobias Brunner <tobias@strongswan.org>
Wed, 19 Apr 2017 16:56:43 +0000 (18:56 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 19 Apr 2017 16:56:43 +0000 (18:56 +0200)
If we jump to `end` without this we crash (not necessarily visibly) due
to a double free and the actual error message is not printed.

src/pki/commands/issue.c

index b0399c7..e41c56d 100644 (file)
@@ -406,6 +406,7 @@ static int issue()
                goto end;
        }
        public->destroy(public);
+       public = NULL;
 
        if (hex)
        {