summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2011-08-07 14:25:30 +0000
committerXinchen Hui <laruence@php.net>2011-08-07 14:25:30 +0000
commit376a04e14f27697a15d53d9de29357eaf9bfe553 (patch)
tree75f5a9af233de6cbf4eaa6faf634ce3b1c18df60
parent59b7b2701c4dd8371459ecbf6962fa42ce804ee2 (diff)
downloadphp-git-376a04e14f27697a15d53d9de29357eaf9bfe553.tar.gz
revert -r314422
No need to check erealloc's return
-rw-r--r--ext/standard/basic_functions.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index cce6880338..ba83eb38d8 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -4252,15 +4252,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));
@@ -4297,10 +4297,6 @@ PHP_FUNCTION(getopt)
}
} else {
opts = (opt_struct*) erealloc(opts, sizeof(opt_struct) * (len + 1));
- if (!opts) {
- RETURN_FALSE;
- }
-
orig_opts = opts;
opts += len;
}