mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
revert -r314422
No need to check erealloc's return
This commit is contained in:
parent
a35462c71c
commit
2ce3f11f4b
1 changed files with 4 additions and 8 deletions
|
@ -4282,15 +4282,15 @@ PHP_FUNCTION(getopt)
|
|||
/* the first <len> slots are filled by the one short ops
|
||||
* we now extend our array and jump to the new added structs */
|
||||
opts = (opt_struct *) erealloc(opts, sizeof(opt_struct) * (len + count + 1));
|
||||
if (!opts) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
orig_opts = opts;
|
||||
opts += len;
|
||||
|
||||
memset(opts, 0, count * sizeof(opt_struct));
|
||||
|
||||
if (!opts) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* Reset the array indexes. */
|
||||
zend_hash_internal_pointer_reset(Z_ARRVAL_P(p_longopts));
|
||||
|
||||
|
@ -4327,10 +4327,6 @@ PHP_FUNCTION(getopt)
|
|||
}
|
||||
} else {
|
||||
opts = (opt_struct*) erealloc(opts, sizeof(opt_struct) * (len + 1));
|
||||
if (!opts) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
orig_opts = opts;
|
||||
opts += len;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue