File tree Expand file tree Collapse file tree 3 files changed +3
-14
lines changed
Expand file tree Collapse file tree 3 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -619,10 +619,7 @@ ossl_x509_get_extensions(VALUE self)
619619
620620 GetX509 (self , x509 );
621621 count = X509_get_ext_count (x509 );
622- if (count < 0 ) {
623- return rb_ary_new ();
624- }
625- ary = rb_ary_new2 (count );
622+ ary = rb_ary_new_capa (count );
626623 for (i = 0 ; i < count ; i ++ ) {
627624 ext = X509_get_ext (x509 , i ); /* NO DUP - don't free! */
628625 rb_ary_push (ary , ossl_x509ext_new (ext ));
Original file line number Diff line number Diff line change @@ -449,11 +449,7 @@ ossl_x509crl_get_extensions(VALUE self)
449449
450450 GetX509CRL (self , crl );
451451 count = X509_CRL_get_ext_count (crl );
452- if (count < 0 ) {
453- OSSL_Debug ("count < 0???" );
454- return rb_ary_new ();
455- }
456- ary = rb_ary_new2 (count );
452+ ary = rb_ary_new_capa (count );
457453 for (i = 0 ; i < count ; i ++ ) {
458454 ext = X509_CRL_get_ext (crl , i ); /* NO DUP - don't free! */
459455 rb_ary_push (ary , ossl_x509ext_new (ext ));
Original file line number Diff line number Diff line change @@ -194,11 +194,7 @@ ossl_x509revoked_get_extensions(VALUE self)
194194
195195 GetX509Rev (self , rev );
196196 count = X509_REVOKED_get_ext_count (rev );
197- if (count < 0 ) {
198- OSSL_Debug ("count < 0???" );
199- return rb_ary_new ();
200- }
201- ary = rb_ary_new2 (count );
197+ ary = rb_ary_new_capa (count );
202198 for (i = 0 ; i < count ; i ++ ) {
203199 ext = X509_REVOKED_get_ext (rev , i );
204200 rb_ary_push (ary , ossl_x509ext_new (ext ));
You can’t perform that action at this time.
0 commit comments