File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4898,18 +4898,16 @@ WOLFSSL_ECDSA_SIG *wolfSSL_ECDSA_SIG_new(void)
48984898 DYNAMIC_TYPE_ECC );
48994899 if (sig == NULL ) {
49004900 WOLFSSL_MSG ("wolfSSL_ECDSA_SIG_new malloc ECDSA signature failure" );
4901- err = 1 ;
4901+ return NULL ;
49024902 }
49034903
4904- if (!err ) {
4905- /* Set s to NULL in case of error. */
4906- sig -> s = NULL ;
4907- /* Allocate BN into r. */
4908- sig -> r = wolfSSL_BN_new ();
4909- if (sig -> r == NULL ) {
4910- WOLFSSL_MSG ("wolfSSL_ECDSA_SIG_new malloc ECDSA r failure" );
4911- err = 1 ;
4912- }
4904+ /* Set s to NULL in case of error. */
4905+ sig -> s = NULL ;
4906+ /* Allocate BN into r. */
4907+ sig -> r = wolfSSL_BN_new ();
4908+ if (sig -> r == NULL ) {
4909+ WOLFSSL_MSG ("wolfSSL_ECDSA_SIG_new malloc ECDSA r failure" );
4910+ err = 1 ;
49134911 }
49144912 if (!err ) {
49154913 /* Allocate BN into s. */
@@ -4920,7 +4918,7 @@ WOLFSSL_ECDSA_SIG *wolfSSL_ECDSA_SIG_new(void)
49204918 }
49214919 }
49224920
4923- if (err && ( sig != NULL ) ) {
4921+ if (err ) {
49244922 /* Dispose of allocated memory. */
49254923 wolfSSL_ECDSA_SIG_free (sig );
49264924 sig = NULL ;
You can’t perform that action at this time.
0 commit comments