Skip to content

Commit

Permalink
GH364: Free memory on an error path
Browse files Browse the repository at this point in the history
Part of RT 3997
Per Ben, just jump to common exit code.

Signed-off-by: Rich Salz <rsalz@akamai.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit cc2829e)
  • Loading branch information
ipuustin authored and Rich Salz committed Aug 13, 2015
1 parent 5859bc6 commit 25efcb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crypto/x509/x509_vfy.c
Expand Up @@ -354,7 +354,8 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
if (!sk_X509_push(ctx->chain, x)) {
X509_free(xtmp);
X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
return 0;
ok = 0;
goto done;
}
num++;
}
Expand Down

3 comments on commit 25efcb4

@GyrosGeier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails to compile in the 1.0.2 branch, because the "done" label does not exist.

@richsalz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

about to fix, sorry about that.

@GyrosGeier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.