File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -4282,15 +4282,15 @@ PHP_FUNCTION(getopt)
4282
4282
/* the first <len> slots are filled by the one short ops
4283
4283
* we now extend our array and jump to the new added structs */
4284
4284
opts = (opt_struct * ) erealloc (opts , sizeof (opt_struct ) * (len + count + 1 ));
4285
+ if (!opts ) {
4286
+ RETURN_FALSE ;
4287
+ }
4288
+
4285
4289
orig_opts = opts ;
4286
4290
opts += len ;
4287
4291
4288
4292
memset (opts , 0 , count * sizeof (opt_struct ));
4289
4293
4290
- if (!opts ) {
4291
- RETURN_FALSE ;
4292
- }
4293
-
4294
4294
/* Reset the array indexes. */
4295
4295
zend_hash_internal_pointer_reset (Z_ARRVAL_P (p_longopts ));
4296
4296
@@ -4327,6 +4327,10 @@ PHP_FUNCTION(getopt)
4327
4327
}
4328
4328
} else {
4329
4329
opts = (opt_struct * ) erealloc (opts , sizeof (opt_struct ) * (len + 1 ));
4330
+ if (!opts ) {
4331
+ RETURN_FALSE ;
4332
+ }
4333
+
4330
4334
orig_opts = opts ;
4331
4335
opts += len ;
4332
4336
}
You can’t perform that action at this time.
0 commit comments