minor defensive fko_destroy() calls in two error condition blocks
authorMichael Rash <mbr@cipherdyne.org>
Wed, 15 Aug 2012 02:21:34 +0000 (22:21 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Wed, 15 Aug 2012 02:21:34 +0000 (22:21 -0400)
server/incoming_spa.c

index 2703a77..726cc06 100644 (file)
@@ -388,6 +388,8 @@ incoming_spa(fko_srv_options_t *opts)
                         "(stanza #%d) Error creating fko context (before decryption): %s",
                         stanza_num, fko_errstr(res)
                     );
+                    if(ctx != NULL)
+                        fko_destroy(ctx);
                     acc = acc->next;
                     continue;
                 }
@@ -402,6 +404,8 @@ incoming_spa(fko_srv_options_t *opts)
                             "(stanza #%d) Error setting GPG keyring path to %s: %s",
                             stanza_num, acc->gpg_home_dir, fko_errstr(res)
                         );
+                        if(ctx != NULL)
+                            fko_destroy(ctx);
                         acc = acc->next;
                         continue;
                     }