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)
619
619
620
620
GetX509 (self , x509 );
621
621
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 );
626
623
for (i = 0 ; i < count ; i ++ ) {
627
624
ext = X509_get_ext (x509 , i ); /* NO DUP - don't free! */
628
625
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)
449
449
450
450
GetX509CRL (self , crl );
451
451
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 );
457
453
for (i = 0 ; i < count ; i ++ ) {
458
454
ext = X509_CRL_get_ext (crl , i ); /* NO DUP - don't free! */
459
455
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)
194
194
195
195
GetX509Rev (self , rev );
196
196
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 );
202
198
for (i = 0 ; i < count ; i ++ ) {
203
199
ext = X509_REVOKED_get_ext (rev , i );
204
200
rb_ary_push (ary , ossl_x509ext_new (ext ));
You can’t perform that action at this time.
0 commit comments