Skip to content

Commit 2ce3f11

Browse files
committed
revert -r314422
No need to check erealloc's return
1 parent a35462c commit 2ce3f11

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

ext/standard/basic_functions.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4282,15 +4282,15 @@ PHP_FUNCTION(getopt)
42824282
/* the first <len> slots are filled by the one short ops
42834283
* we now extend our array and jump to the new added structs */
42844284
opts = (opt_struct *) erealloc(opts, sizeof(opt_struct) * (len + count + 1));
4285-
if (!opts) {
4286-
RETURN_FALSE;
4287-
}
4288-
42894285
orig_opts = opts;
42904286
opts += len;
42914287

42924288
memset(opts, 0, count * sizeof(opt_struct));
42934289

4290+
if (!opts) {
4291+
RETURN_FALSE;
4292+
}
4293+
42944294
/* Reset the array indexes. */
42954295
zend_hash_internal_pointer_reset(Z_ARRVAL_P(p_longopts));
42964296

@@ -4327,10 +4327,6 @@ PHP_FUNCTION(getopt)
43274327
}
43284328
} else {
43294329
opts = (opt_struct*) erealloc(opts, sizeof(opt_struct) * (len + 1));
4330-
if (!opts) {
4331-
RETURN_FALSE;
4332-
}
4333-
43344330
orig_opts = opts;
43354331
opts += len;
43364332
}

0 commit comments

Comments
 (0)